net.sf.freecol.common.util
Class ReplayableInputStream
java.lang.Object
java.io.InputStream
net.sf.freecol.common.util.ReplayableInputStream
- All Implemented Interfaces:
- java.io.Closeable
public final class ReplayableInputStream
- extends java.io.InputStream
Wraps a InputStream and adds
InputStream.mark(int) and InputStream.reset()
support.
| Methods inherited from class java.io.InputStream |
available, close, read, read, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NORMAL
private static final int NORMAL
- See Also:
- Constant Field Values
RECORDING
private static final int RECORDING
- See Also:
- Constant Field Values
REPLAYING
private static final int REPLAYING
- See Also:
- Constant Field Values
underlyingStream
private final java.io.InputStream underlyingStream
state
private int state
replayBuffer
private byte[] replayBuffer
recordedBytes
private int recordedBytes
replayedBytes
private int replayedBytes
ReplayableInputStream
public ReplayableInputStream(java.io.InputStream in)
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
java.io.IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.InputStream
mark
public void mark(int readlimit)
- Overrides:
mark in class java.io.InputStream
reset
public void reset()
throws java.io.IOException
- Overrides:
reset in class java.io.InputStream
- Throws:
java.io.IOException