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
ConstructorDescriptionRecordedInputStream
(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
- aInputStream
object.maxBufferSize
- aInteger
object.
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getString
public String getString(String encoding) throws UnsupportedEncodingException, BufferExceededException getString.
- Parameters:
encoding
- aString
object.- Returns:
- a
String
object. - Throws:
UnsupportedEncodingException
- if any.BufferExceededException
- if any.
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-