Package org.lobobrowser.util.io
Class RecordedInputStream
java.lang.Object
java.io.InputStream
org.lobobrowser.util.io.RecordedInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
RecordedInputStream
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
consumeToEOF
- Throws:
IOException
-
getBytesRead
- Throws:
BufferExceededException
-
getString
public String getString(String encoding) throws UnsupportedEncodingException, BufferExceededException -
hasReachedEOF
public boolean hasReachedEOF()
-