at.gv.egiz.pdfas.impl.input
Class DelimitedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by at.gv.egiz.pdfas.impl.input.DelimitedInputStream
All Implemented Interfaces:
Closeable

public class DelimitedInputStream
extends InputStream

An input stream that has a delimited length.

Author:
wprinz

Field Summary
protected  int bytes_to_read
          The number of bytes that can be read from the stream.
protected  InputStream is
          The underlying InputStream.
 
Constructor Summary
DelimitedInputStream(InputStream is, int length)
          Constructs the DelimitedInputStream from which a maximum of length bytes can be read.
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 long skip(long n)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

is

protected InputStream is
The underlying InputStream.


bytes_to_read

protected int bytes_to_read
The number of bytes that can be read from the stream.

Constructor Detail

DelimitedInputStream

public DelimitedInputStream(InputStream is,
                            int length)
Constructs the DelimitedInputStream from which a maximum of length bytes can be read.

Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException
See Also:
InputStream.read()

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException
See Also:
InputStream.read(byte[], int, int)

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException
See Also:
InputStream.read(byte[])

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException
See Also:
InputStream.skip(long)

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException
See Also:
InputStream.close()

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException
See Also:
InputStream.available()


Copyright © 2006-2011. All Rights Reserved.