public class RandomAccessStreamReader extends RandomAccessReader
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CHUNK_LENGTH |
| Constructor and Description |
|---|
RandomAccessStreamReader(InputStream stream) |
RandomAccessStreamReader(InputStream stream,
int chunkLength) |
RandomAccessStreamReader(InputStream stream,
int chunkLength,
long streamLength) |
| Modifier and Type | Method and Description |
|---|---|
byte |
getByte(int index)
Gets the byte value at the specified byte
index. |
byte[] |
getBytes(int index,
int count)
Returns the required number of bytes from the specified index from the underlying source.
|
long |
getLength()
Reads to the end of the stream, in order to determine the total number of bytes.
|
int |
toUnshiftedOffset(int localOffset) |
getBit, getDouble64, getFloat32, getInt16, getInt24, getInt32, getInt64, getInt8, getNullTerminatedBytes, getNullTerminatedString, getNullTerminatedStringValue, getS15Fixed16, getString, getString, getStringValue, getUInt16, getUInt32, getUInt8, isMotorolaByteOrder, setMotorolaByteOrderpublic static final int DEFAULT_CHUNK_LENGTH
public RandomAccessStreamReader(InputStream stream)
public RandomAccessStreamReader(InputStream stream, int chunkLength)
public RandomAccessStreamReader(InputStream stream, int chunkLength, long streamLength)
public long getLength()
throws IOException
RandomAccessReader.getLength in class RandomAccessReaderIOExceptionpublic int toUnshiftedOffset(int localOffset)
toUnshiftedOffset in class RandomAccessReaderpublic byte getByte(int index)
throws IOException
RandomAccessReaderindex.
Implementations should not perform any bounds checking in this method. That should be performed
in validateIndex and isValidIndex.
getByte in class RandomAccessReaderindex - The index from which to read the byteBufferBoundsException - if the requested byte is beyond the end of the underlying data sourceIOException - if the byte is unable to be readpublic byte[] getBytes(int index,
int count)
throws IOException
RandomAccessReadergetBytes in class RandomAccessReaderindex - The index from which the bytes begins in the underlying sourcecount - The number of bytes to be returnedBufferBoundsException - if the requested bytes extend beyond the end of the underlying data sourceIOException - if the byte is unable to be readCopyright © 2002-2020 Drew Noakes. All Rights Reserved.