public abstract class InputByteStreamImpl extends Object implements InputByteStream
EOF| Modifier and Type | Method and Description |
|---|---|
long |
bytesAvailable()
Only for internal engineering use.
|
abstract void |
close()
Closes this InputByteStream and releases any system resources associated with the stream.
|
boolean |
eof()
Only for internal engineering use.
|
abstract long |
getPosition()
Only for internal engineering use.
|
abstract long |
length()
Only for internal engineering use.
|
abstract int |
read()
Only for internal engineering use.
|
int |
read(byte[] bytes)
Only for internal engineering use.
|
abstract int |
read(byte[] bytes,
int position,
int length)
Only for internal engineering use.
|
abstract InputByteStream |
seek(long position)
Only for internal engineering use.
|
InputByteStream |
slice()
Only for internal engineering use.
|
abstract InputByteStream |
slice(long begin,
long length)
Only for internal engineering use.
|
InputStream |
toInputStream()
Create an InputStream that represents the same data as this InputByteStream.
|
String |
toString()
Only for internal engineering use.
|
int |
unget()
Only for internal engineering use.
|
public abstract 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.slice in interface InputByteStreambegin - Offset within the current InputByteStream to start the slice.length - The length of the slice.InputByteStream.IOExceptionpublic InputByteStream 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.slice in interface InputByteStreamInputByteStream.IOExceptionpublic abstract int read()
throws IOException
InputByteStream-1. If not beyond the end
of the underlying data the current position is incremented by 1.read in interface InputByteStream-1 if at or beyond EOF.IOExceptionpublic abstract int read(byte[] bytes,
int position,
int length)
throws IOException
InputByteStreamread in interface InputByteStreambytes - The destination array.position - The offset in the byte array to put the first byte read.length - The number of bytes to read.IOExceptionpublic int read(byte[] bytes)
throws IOException
InputByteStreamread in interface InputByteStreambytes - The destination array.IOExceptionpublic int unget()
throws IOException
InputByteStreamunget in interface InputByteStreamIOExceptionpublic abstract InputByteStream seek(long position) throws IOException
seek in interface InputByteStreamposition - Where to set the current position.IOExceptionpublic abstract long getPosition()
throws IOException
InputByteStreamgetPosition in interface InputByteStreamIOExceptionpublic abstract long length()
throws IOException
InputByteStreamInputByteStream.length in interface InputByteStreamInputByteStream.IOExceptionpublic long bytesAvailable()
throws IOException
InputByteStreambytesAvailable in interface InputByteStreamInputByteStream.IOExceptionpublic boolean eof()
throws IOException
InputByteStreamInputByteStream at or beyond the
end of the underlying data.eof in interface InputByteStreamIOExceptionpublic abstract void close()
throws IOException
InputByteStreamclose in interface InputByteStreamIOExceptionpublic String toString()
public InputStream toInputStream() throws IOException
InputByteStreamtoInputStream in interface InputByteStreamIOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved