java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.derby.iapi.services.io.LimitInputStream
org.apache.derbyTesting.unitTests.services.MarkedLimitInputStream
- All Implemented Interfaces:
- java.io.Closeable, org.apache.derby.iapi.services.io.Limit
- public class MarkedLimitInputStream
- extends org.apache.derby.iapi.services.io.LimitInputStream
An input stream whose internal data is in blocks, the format of each block is
(boolean isLastBlock, int blockLength, sequence of blockLength bytes)
All blocks except for the last block must have isLastBlock set to false.
The last block must have isLastBlock set to true.
This class implements an input stream whose length is limited, yet
the creator (writer) of the stream does not need to know the entire length
before creating it.
|
Method Summary |
int |
read()
Calls the in.read() method |
int |
read(byte[] b,
int off,
int len)
Calls the in.read(byte[], int, int) method. |
long |
skip(long count)
Calls the in.skip(long) method |
private void |
start()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isLastBlock
protected boolean isLastBlock
blockLength
protected int blockLength
MarkedLimitInputStream
public MarkedLimitInputStream(java.io.DataInputStream in)
throws java.io.IOException
start
private void start()
throws java.io.IOException
read
public int read()
throws java.io.IOException
- Description copied from class:
java.io.FilterInputStream
- Calls the
in.read() method
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Description copied from class:
java.io.FilterInputStream
- Calls the
in.read(byte[], int, int) method.
skip
public long skip(long count)
throws java.io.IOException
- Description copied from class:
java.io.FilterInputStream
- Calls the
in.skip(long) method