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
ConstructorDescriptionCreates aRereadableInputStream
which uses the givenInputStream
as its source. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
RereadableInputStream
Creates aRereadableInputStream
which uses the givenInputStream
as its source.- Parameters:
src
- source input stream
-
-
Method Details
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
mark
public void mark(int readlimit) Set the current marked position in the stream. Note: ThereadLimit
for this class determines only the initial size of the buffer. Reading more thanreadLimit
bytes after calling this method will not invalidate the previous mark, but will cause the buffer to be resized.- Overrides:
mark
in classInputStream
- Parameters:
readlimit
- the initial buffer size
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-