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)

Method Summary

int
available()
void
close()
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)

Method Details

available

public int available()
            throws IOException

close

public void close()
            throws IOException

getBytesRead

public byte[] getBytesRead()

getString

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

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