org.lobobrowser.util.io
Class RecordedInputStream
java.lang.Object
java.io.InputStream
org.lobobrowser.util.io.RecordedInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class RecordedInputStream
- extends java.io.InputStream
Wraps an InputStream and records all of the
bytes read. This stream supports mark() and reset().
Note: Buffered streams should wrap this class
as opposed to the other way around.
- Author:
- J. H. S.
Methods inherited from class java.io.InputStream |
read, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecordedInputStream
public RecordedInputStream(java.io.InputStream delegate,
int maxBufferSize)
read
public int read()
throws java.io.IOException
- Specified by:
read
in class java.io.InputStream
- Throws:
java.io.IOException
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.InputStream
- Throws:
java.io.IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class java.io.InputStream
mark
public void mark(int readlimit)
- Overrides:
mark
in class java.io.InputStream
reset
public void reset()
throws java.io.IOException
- Overrides:
reset
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
consumeToEOF
public void consumeToEOF()
throws java.io.IOException
- Throws:
java.io.IOException
getBytesRead
public byte[] getBytesRead()
throws BufferExceededException
- Throws:
BufferExceededException
getString
public java.lang.String getString(java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
BufferExceededException
- Throws:
java.io.UnsupportedEncodingException
BufferExceededException
hasReachedEOF
public boolean hasReachedEOF()