SK.gnome.dwarf.utils.io
Class LimitedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
SK.gnome.dwarf.utils.io.LimitedInputStream
- public class LimitedInputStream
- extends java.io.FilterInputStream
Provides limited-length input stream.
This stream filteres the source input stream and provides up to the maximum
length of the source octets.
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary |
LimitedInputStream(java.io.InputStream in,
int limit)
Creates a new LimitedInputStream with the given length limit. |
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 |
LimitedInputStream
public LimitedInputStream(java.io.InputStream in,
int limit)
- Creates a new LimitedInputStream with the given length limit.
- Parameters:
in
- the source streamlimit
- the length limit
- Throws:
java.lang.IllegalArgumentException
- if the limit is negative
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,
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
Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.