Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derbyTesting.unitTests.services
Class MarkedLimitInputStream  view MarkedLimitInputStream download MarkedLimitInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.apache.derby.iapi.services.io.LimitInputStream
              extended byorg.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.


Field Summary
protected  int blockLength
           
protected  boolean isLastBlock
           
 
Fields inherited from class org.apache.derby.iapi.services.io.LimitInputStream
limitInPlace, remainingBytes
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MarkedLimitInputStream(java.io.DataInputStream in)
           
 
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 org.apache.derby.iapi.services.io.LimitInputStream
available, clearLimit, setInput, setLimit
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isLastBlock

protected boolean isLastBlock

blockLength

protected int blockLength
Constructor Detail

MarkedLimitInputStream

public MarkedLimitInputStream(java.io.DataInputStream in)
                       throws java.io.IOException
Method Detail

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