Class ByteReader
java.lang.Object
cool.scx.bytes.ByteReader
- All Implemented Interfaces:
IByteReader,AutoCloseable
ByteReader
- Version:
- 0.0.1
- Author:
- scx567888
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longindexOf(ByteIndexer indexer, long maxLength, long maxPullCount) intintinputStreamRead(byte[] b, int off, int len) byte[]inputStreamReadNBytes(long len) longinputStreamTransferTo(OutputStream out, long maxLength) voidmark()bytepeek()<X extends Throwable>
voidpeek(ByteConsumer<X> byteConsumer, long maxLength, long maxPullCount) byteread()<X extends Throwable>
voidread(ByteConsumer<X> byteConsumer, long maxLength, long maxPullCount) voidreset()
-
Field Details
-
byteSupplier
-
head
-
tail
-
markNode
-
markNodePosition
public int markNodePosition
-
-
Constructor Details
-
ByteReader
-
ByteReader
public ByteReader()
-
-
Method Details
-
read
- Specified by:
readin interfaceIByteReader- Throws:
NoMoreDataExceptionByteSupplierException
-
read
public <X extends Throwable> void read(ByteConsumer<X> byteConsumer, long maxLength, long maxPullCount) throws NoMoreDataException, ByteSupplierException, X - Specified by:
readin interfaceIByteReader- Parameters:
maxPullCount- 底层最大拉取次数- Throws:
NoMoreDataExceptionByteSupplierExceptionX
-
peek
- Specified by:
peekin interfaceIByteReader- Throws:
NoMoreDataExceptionByteSupplierException
-
peek
public <X extends Throwable> void peek(ByteConsumer<X> byteConsumer, long maxLength, long maxPullCount) throws NoMoreDataException, ByteSupplierException, X - Specified by:
peekin interfaceIByteReader- Parameters:
maxPullCount- 底层最大拉取次数- Throws:
NoMoreDataExceptionByteSupplierExceptionX
-
indexOf
public long indexOf(ByteIndexer indexer, long maxLength, long maxPullCount) throws NoMatchFoundException, NoMoreDataException, ByteSupplierException - Specified by:
indexOfin interfaceIByteReader- Parameters:
maxPullCount- 底层最大拉取次数- Throws:
NoMatchFoundExceptionNoMoreDataExceptionByteSupplierException
-
mark
public void mark()- Specified by:
markin interfaceIByteReader
-
reset
public void reset()- Specified by:
resetin interfaceIByteReader
-
inputStreamRead
- Specified by:
inputStreamReadin interfaceIByteReader- Throws:
IOException
-
inputStreamRead
- Specified by:
inputStreamReadin interfaceIByteReader- Throws:
IOException
-
inputStreamTransferTo
- Specified by:
inputStreamTransferToin interfaceIByteReader- Throws:
IOException
-
inputStreamReadNBytes
- Specified by:
inputStreamReadNBytesin interfaceIByteReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIByteReader- Throws:
IOException
-