java.io.Closeable, java.lang.AutoCloseablepublic class WrappedInputStream
extends java.io.FilterInputStream
Note: See the javadoc for WrappedOutputStream for more information.
WrappedOutputStream| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
fClosed |
To mark that the stream is "closed".
|
protected java.io.DataInputStream |
fDataInputStream |
Data input stream.
|
protected int |
fPacketCount |
Bytes left on input stream for current packet.
|
| Constructor | Description |
|---|---|
WrappedInputStream(java.io.InputStream stream) |
Constructs a wrapper for the given an input stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the input stream.
|
int |
read() |
Reads a single byte.
|
int |
read(byte[] b,
int offset,
int length) |
Reads a block of bytes and returns the total number of bytes read.
|
long |
skip(long n) |
Skips the specified number of bytes from the input stream.
|
protected int fPacketCount
protected java.io.DataInputStream fDataInputStream
Note: The data input stream is only used for reading the byte count for performance reasons. We avoid the method indirection for reading the byte data.
protected boolean fClosed
public WrappedInputStream(java.io.InputStream stream)
public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int offset,
int length)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
Note: This method does not close the underlying input stream.
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.FilterInputStreamjava.io.IOException