public class SequentialByteArrayReader extends SequentialReader
| Constructor and Description |
|---|
SequentialByteArrayReader(byte[] bytes) |
SequentialByteArrayReader(byte[] bytes,
int baseIndex) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or skipped
over) from this
SequentialReader without blocking by the next
invocation of a method for this input stream. |
byte |
getByte()
Gets the next byte in the sequence.
|
void |
getBytes(byte[] buffer,
int offset,
int count)
Retrieves bytes, writing them into a caller-provided buffer.
|
byte[] |
getBytes(int count)
Returns the required number of bytes from the sequence.
|
long |
getPosition() |
void |
skip(long n)
Skips forward in the sequence.
|
boolean |
trySkip(long n)
Skips forward in the sequence, returning a boolean indicating whether the skip succeeded, or whether the sequence ended.
|
getDouble64, getFloat32, getInt16, getInt32, getInt64, getInt8, getNullTerminatedBytes, getNullTerminatedString, getNullTerminatedStringValue, getS15Fixed16, getString, getString, getString, getStringValue, getUInt16, getUInt32, getUInt8, isMotorolaByteOrder, setMotorolaByteOrderpublic SequentialByteArrayReader(byte[] bytes)
public SequentialByteArrayReader(byte[] bytes,
int baseIndex)
public long getPosition()
getPosition in class SequentialReaderpublic byte getByte()
throws IOException
SequentialReadergetByte in class SequentialReaderIOExceptionpublic byte[] getBytes(int count)
throws IOException
SequentialReadergetBytes in class SequentialReadercount - The number of bytes to be returnedIOExceptionpublic void getBytes(byte[] buffer,
int offset,
int count)
throws IOException
SequentialReadergetBytes in class SequentialReaderbuffer - The array to write bytes to.offset - The starting position within buffer to write to.count - The number of bytes to be written.IOExceptionpublic void skip(long n)
throws IOException
SequentialReaderEOFException is thrown.skip in class SequentialReadern - the number of byte to skip. Must be zero or greater.EOFException - the end of the sequence is reached.IOException - an error occurred reading from the underlying source.public boolean trySkip(long n)
throws IOException
SequentialReadertrySkip in class SequentialReadern - the number of byte to skip. Must be zero or greater.IOException - an error occurred reading from the underlying source.public int available()
SequentialReaderSequentialReader without blocking by the next
invocation of a method for this input stream. A single read or skip of
this many bytes will not block, but may read or skip fewer bytes.
Note that while some implementations of SequentialReader like
SequentialByteArrayReader will return the total remaining number
of bytes in the stream, others will not. It is never correct to use the
return value of this method to allocate a buffer intended to hold all
data in this stream.
available in class SequentialReaderSequentialReader without blocking or
0 when it reaches the end of the input stream.Copyright © 2010 - 2020 Adobe. All Rights Reserved