public interface InputByteStream
| Modifier and Type | Field and Description |
|---|---|
static int |
EOF
Only for internal engineering use.
|
| Modifier and Type | Method and Description |
|---|---|
long |
bytesAvailable()
Only for internal engineering use.
|
void |
close()
Closes this InputByteStream and releases any system resources associated with the stream.
|
boolean |
eof()
Only for internal engineering use.
|
long |
getPosition()
Only for internal engineering use.
|
long |
length()
Only for internal engineering use.
|
int |
read()
Only for internal engineering use.
|
int |
read(byte[] bytes)
Only for internal engineering use.
|
int |
read(byte[] bytes,
int position,
int length)
Only for internal engineering use.
|
InputByteStream |
seek(long position)
Only for internal engineering use.
|
InputByteStream |
slice()
Only for internal engineering use.
|
InputByteStream |
slice(long begin,
long length)
Only for internal engineering use.
|
InputStream |
toInputStream()
Create an InputStream that represents the same data as this InputByteStream.
|
int |
unget()
Only for internal engineering use.
|
static final int EOF
InputByteStream slice(long begin, long length) throws IOException
InputByteStream that that provides another view on the underlying
data. This new InputByteStream is completely independent and can be read from
and positioned without affecting the original or any other slice
InputByteStream objects. The initial position of the slice is at zero -
the beginning of the slice.begin - Offset within the current InputByteStream to start the slice.length - The length of the slice.InputByteStream.IOExceptionInputByteStream slice() throws IOException
InputByteStream that that provides another view on the underlying
data. This new InputByteStream is completely independent and can be read from
and positioned without affecting the original or any other slice
InputByteStream objects. The initial position of the slice is at zero -
the beginning of the slice. The slice has the same bounds as the original
InputByteStream.
One common but probably incorrect usage of this method is to create a temporary "view"
on the data that is used briefly within a method and then discarded. This is pretty
wasteful and creates a number of small objects. In that case it would be better
to find the current position using getPosition() and store it locally
in the method and then restore the position with setPosition()
before returning from the method.InputByteStream.IOExceptionint read() throws IOException
-1. If not beyond the end
of the underlying data the current position is incremented by 1.-1 if at or beyond EOF.IOExceptionint read(byte[] bytes,
int position,
int length)
throws IOException
bytes - The destination array.position - The offset in the byte array to put the first byte read.length - The number of bytes to read.IOExceptionint read(byte[] bytes) throws IOException
bytes - The destination array.IOExceptionint unget() throws IOException
IOExceptionInputByteStream seek(long position) throws IOException
position - Where to set the current position.IOExceptionlong getPosition()
throws IOException
IOExceptionlong length()
throws IOException
InputByteStream.InputByteStream.IOExceptionlong bytesAvailable()
throws IOException
InputByteStream.IOExceptionboolean eof()
throws IOException
InputByteStream at or beyond the
end of the underlying data.IOExceptionvoid close()
throws IOException
IOExceptionInputStream toInputStream() throws IOException
IOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved