| java.lang.Object java.io.InputStream org.ozoneDB.xml.util.ChunkInputStream
Field Summary | |
protected byte[] | buf The internal buffer array where the data is stored. | protected int | pos The current position in the buffer. |
Constructor Summary | |
public | ChunkInputStream(byte[] data) Creates a BufferedInputStream
and saves its argument, the input stream
in , for later use. |
Method Summary | |
final public synchronized int | available() Returns the number of bytes that can be read from this input
stream without blocking. | final public synchronized void | close() Closes this input stream and releases any system resources
associated with the stream. | final public boolean | markSupported() Tests if this input stream supports the mark
and reset methods. | public synchronized int | read() See
the general contract of the read
method of InputStream . | final public synchronized int | read(byte[] b, int off, int len) Reads bytes from this byte-input stream into the specified byte array,
starting at the given offset.
Parameters: b - destination buffer. Parameters: off - offset at which to start storing bytes. Parameters: len - maximum number of bytes to read. | final public void | setBuffer(byte[] buffer) Set a new buffer for this input stream. | final public synchronized long | skip(long n) See the general contract of the skip
method of InputStream .
Parameters: n - the number of bytes to be skipped. |
buf | protected byte[] buf(Code) | | The internal buffer array where the data is stored. When necessary,
it may be replaced by another array of
a different size.
|
pos | protected int pos(Code) | | The current position in the buffer. This is the index of the next
character to be read from the buf array.
This value is always in the range 0
through count . If it is less
than count , then buf[pos]
is the next byte to be supplied as input;
if it is equal to count , then
the next read or skip
operation will require more bytes to be
read from the contained input stream.
See Also: java.io.BufferedInputStream.buf |
ChunkInputStream | public ChunkInputStream(byte[] data)(Code) | | Creates a BufferedInputStream
and saves its argument, the input stream
in , for later use. An internal
buffer array is created and stored in buf .
Parameters: in - the underlying input stream. |
available | final public synchronized int available() throws IOException(Code) | | Returns the number of bytes that can be read from this input
stream without blocking.
the number of bytes that can be read from this inputstream without blocking. exception: IOException - if an I/O error occurs. |
close | final public synchronized void close() throws IOException(Code) | | Closes this input stream and releases any system resources
associated with the stream.
exception: IOException - if an I/O error occurs. |
markSupported | final public boolean markSupported()(Code) | | Tests if this input stream supports the mark
and reset methods. The markSupported
method of ChunkInputStream returns false .
a boolean indicating if this stream type supportsthe mark and reset methods. |
read | final public synchronized int read(byte[] b, int off, int len) throws IOException(Code) | | Reads bytes from this byte-input stream into the specified byte array,
starting at the given offset.
Parameters: b - destination buffer. Parameters: off - offset at which to start storing bytes. Parameters: len - maximum number of bytes to read. the number of bytes read, or -1 if the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. |
setBuffer | final public void setBuffer(byte[] buffer)(Code) | | Set a new buffer for this input stream.
Parameters: buffer - the data buffer |
skip | final public synchronized long skip(long n) throws IOException(Code) | | See the general contract of the skip
method of InputStream .
Parameters: n - the number of bytes to be skipped. the actual number of bytes skipped. exception: IOException - if an I/O error occurs. |
|
|