public class PaddedInputByteStream extends InputByteStreamImpl
InputByteStreamImpl abstract class.EOF| Constructor and Description |
|---|
PaddedInputByteStream(InputByteStream ibs,
int paddedChar,
long padLength)
constructor with InputByteStream, character to be padded and padding length as parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this InputByteStream and releases any system resources associated with the stream.
|
long |
getPosition()
Get the current position.
|
long |
length()
The maximum number of bytes that can be read from this
InputByteStream. |
int |
read()
Read the byte at the current position.
|
int |
read(byte[] bytes,
int position,
int length)
Read an array of bytes starting at the current position.
|
InputByteStream |
seek(long position)
Set the current position in the underlying data.
|
InputByteStream |
slice(long begin,
long length)
Create a new
InputByteStream that provides another view on the underlying
data. |
bytesAvailable, eof, read, slice, toInputStream, toString, ungetpublic PaddedInputByteStream(InputByteStream ibs, int paddedChar, long padLength)
ibs - paddedChar - padLength - public void close()
throws IOException
close in interface InputByteStreamclose in class InputByteStreamImplIOExceptionpublic long getPosition()
throws IOException
getPosition in interface InputByteStreamgetPosition in class InputByteStreamImplIOExceptionpublic long length()
throws IOException
InputByteStream.length in interface InputByteStreamlength in class InputByteStreamImplInputByteStream.IOExceptionpublic int read()
throws IOException
-1. If not beyond the end
of the underlying data the current position is incremented by 1.read in interface InputByteStreamread in class InputByteStreamImpl-1 if at or beyond EOF.IOExceptionpublic int read(byte[] bytes,
int position,
int length)
throws IOException
read in interface InputByteStreamread in class InputByteStreamImplbytes - The destination array.position - The offset in the byte array to put the first byte read.length - The number of bytes to read.IOExceptionpublic InputByteStream seek(long position) throws IOException
seek in interface InputByteStreamseek in class InputByteStreamImplposition - Where to set the current position.IOExceptionpublic InputByteStream slice(long begin, long length) throws IOException
InputByteStream 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 InputByteStreamslice in class InputByteStreamImplbegin - Offset within the current InputByteStream to start the slice.length - The length of the slice.InputByteStream.IOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved