Package VASSAL.tools.io
Class RereadableInputStream
java.lang.Object
java.io.InputStream
VASSAL.tools.io.RereadableInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An rereadable
InputStream. The reset() method may be
uesd to rewind this input stream to a previously mark(int)ed
location.- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aRereadableInputStreamwhich uses the givenInputStreamas its source. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
RereadableInputStream
Creates aRereadableInputStreamwhich uses the givenInputStreamas its source.- Parameters:
src- source input stream
-
-
Method Details
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit) Set the current marked position in the stream. Note: ThereadLimitfor this class determines only the initial size of the buffer. Reading more thanreadLimitbytes after calling this method will not invalidate the previous mark, but will cause the buffer to be resized.- Overrides:
markin classInputStream- Parameters:
readlimit- the initial buffer size
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-