com.github.stephenc.javaisotools.sabre.io
Class LimitingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.github.stephenc.javaisotools.sabre.io.LimitingInputStream
All Implemented Interfaces:
Closeable

public class LimitingInputStream
extends FilterInputStream

Author:
hartle

TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates


Field Summary
protected  int limit
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LimitingInputStream(InputStream inputStream, int limit)
           
 
Method Summary
 int available()
           
 int getLimit()
           
 int read()
           
 int read(byte[] buffer)
           
 int read(byte[] buffer, int position, int length)
           
 void setLimit(int limit)
           
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, reset, skip
 
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

LimitingInputStream

public LimitingInputStream(InputStream inputStream,
                           int limit)
Method Detail

setLimit

public void setLimit(int limit)

getLimit

public int getLimit()

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buffer)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buffer,
                int position,
                int length)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException


Copyright © 2013. All Rights Reserved.