fi.iki.hsivonen.io
Class BoundednputStream
java.lang.Object
java.io.InputStream
fi.iki.hsivonen.io.BoundednputStream
- All Implemented Interfaces:
- Closeable
public class BoundednputStream
- extends InputStream
- Version:
- $Id: BoundednputStream.java,v 1.2 2005/07/24 07:35:24 hsivonen Exp $
- Author:
- hsivonen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
private InputStream delegate
counter
private long counter
limit
private long limit
BoundednputStream
public BoundednputStream(InputStream delegate,
long limit)
- Parameters:
delegate
- limit
-
checkLimit
private void checkLimit()
throws IOException
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
- See Also:
InputStream.available()
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
- See Also:
InputStream.close()
mark
public void mark(int arg0)
- Overrides:
mark
in class InputStream
- See Also:
InputStream.mark(int)
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class InputStream
- See Also:
InputStream.markSupported()
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
- See Also:
InputStream.read()
read
public int read(byte[] arg0)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
- See Also:
InputStream.read(byte[])
read
public int read(byte[] arg0,
int arg1,
int arg2)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
- See Also:
InputStream.read(byte[], int, int)
reset
public void reset()
throws IOException
- Overrides:
reset
in class InputStream
- Throws:
IOException
- See Also:
InputStream.reset()
skip
public long skip(long arg0)
throws IOException
- Overrides:
skip
in class InputStream
- Throws:
IOException
- See Also:
InputStream.skip(long)