com.cometway.io
Class FixedLengthReader
java.lang.Object
java.io.InputStream
com.cometway.io.ReaderInputStream
com.cometway.io.FixedLengthReader
- All Implemented Interfaces:
- java.io.Closeable
public class FixedLengthReader
- extends ReaderInputStream
This subclass of ReaderInputStream is a wrapper for a Reader that limits
the number of bytes that can be read from this InputStream.
|
Method Summary |
void |
close()
|
int |
read()
|
int |
read(byte[] in)
|
int |
read(byte[] in,
int a,
int b)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
allowStreamClose
public boolean allowStreamClose
FixedLengthReader
public FixedLengthReader(java.io.Reader reader,
int readLimit)
read
public int read()
throws java.io.IOException
- Overrides:
read in class ReaderInputStream
- Throws:
java.io.IOException
read
public int read(byte[] in)
throws java.io.IOException
- Overrides:
read in class ReaderInputStream
- Throws:
java.io.IOException
read
public int read(byte[] in,
int a,
int b)
throws java.io.IOException
- Overrides:
read in class ReaderInputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class ReaderInputStream
- Throws:
java.io.IOException