com.imagero.uio.io
Class LimitedInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.imagero.uio.io.LimitedInputStream

public class LimitedInputStream
extends java.io.FilterInputStream

InputStream that reads specified number of bytes


Field Summary
protected  int limit
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LimitedInputStream(java.io.InputStream in, int limit)
          create new LimitedInputStream
 
Method Summary
 int available()
           
 void mark(int readlimit)
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.FilterInputStream
close, markSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

limit

protected int limit
Constructor Detail

LimitedInputStream

public LimitedInputStream(java.io.InputStream in,
                          int limit)
create new LimitedInputStream

Parameters:
in - InputStream
limit - read limit
Method Detail

available

public int available()
              throws java.io.IOException
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Throws:
java.io.IOException

mark

public void mark(int readlimit)

reset

public void reset()
           throws java.io.IOException
Throws:
java.io.IOException