net.i2p.util
Class LookaheadInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
net.i2p.util.LookaheadInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class LookaheadInputStream
- extends java.io.FilterInputStream
Simple lookahead buffer to keep the last K bytes in reserve,
configured to easily be reused. Currently only used by the
ResettableGZIPInputStream
Fields inherited from class java.io.FilterInputStream |
in |
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LookaheadInputStream
public LookaheadInputStream(int lookaheadSize)
getEOFReached
public boolean getEOFReached()
initialize
public void initialize(java.io.InputStream src)
throws java.io.IOException
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Overrides:
read
in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf)
throws java.io.IOException
- Overrides:
read
in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf,
int off,
int len)
throws java.io.IOException
- Overrides:
read
in class java.io.FilterInputStream
- Throws:
java.io.IOException
getFooter
public byte[] getFooter()
- grab the lookahead footer
main
public static void main(java.lang.String[] args)