Package org.loboevolution.common
Class RecordedInputStream
java.lang.Object
java.io.InputStream
org.loboevolution.common.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
ConstructorsConstructorDescriptionRecordedInputStream(InputStream delegate, int maxBufferSize) Constructor for RecordedInputStream. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
RecordedInputStream
Constructor for RecordedInputStream.
- Parameters:
delegate- aInputStreamobject.maxBufferSize- aIntegerobject.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
getString
public String getString(String encoding) throws UnsupportedEncodingException, BufferExceededException getString.
- Parameters:
encoding- aStringobject.- Returns:
- a
Stringobject. - Throws:
UnsupportedEncodingException- if any.BufferExceededException- if any.
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-