org.lobobrowser.util.io

Class RecordedInputStream


public class RecordedInputStream
extends InputStream

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

RecordedInputStream(InputStream delegate, int maxBufferSize)

Method Summary

int
available()
void
close()
void
consumeToEOF()
byte[]
getBytesRead()
String
getString(String encoding)
boolean
hasReachedEOF()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] buffer, int offset, int length)
void
reset()

Constructor Details

RecordedInputStream

public RecordedInputStream(InputStream delegate,
                           int maxBufferSize)

Method Details

available

public int available()
            throws IOException

close

public void close()
            throws IOException

consumeToEOF

public void consumeToEOF()
            throws IOException

getBytesRead

public byte[] getBytesRead()
            throws BufferExceededException

getString

public String getString(String encoding)
            throws java.io.UnsupportedEncodingException,
                   BufferExceededException

hasReachedEOF

public boolean hasReachedEOF()

mark

public void mark(int readlimit)

markSupported

public boolean markSupported()

read

public int read()
            throws IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
            throws IOException

reset

public void reset()
            throws IOException