borland Packages Class Hierarchy jbcl.io Package Index
java.lang.Object +----java.io.InputStream +----java.io.FilterInputStream +----borland.jbcl.io.FastBufferedInputStream
Variables Constructors Properties Methods
An unsynchronized buffered input stream that reads in characters from a stream without causing a read every time. The data is read into a buffer, then subsequent reads result in fast buffer access. This class is patterned after java.io.BufferedInputStream. The primary difference is that all access is unsynchronized (not thread-safe), for faster response.
public FastBufferedInputStream(java.io.InputStream in)Creates a new buffered stream with a default buffer size.
Parameters:
public FastBufferedInputStream(java.io.InputStream in, int size)Creates a new buffered stream with the specified buffer size.
Parameters:
public int available()Returns the number of bytes that can be read without blocking. This total is the number of bytes in the buffer and the number of bytes available from the input stream.
Overrides: java.io.FilterInputStream.available()
protected void fill()Reads as much as will fit into buffers.
public void mark(int readlimit)Marks the current position in the input stream. A subsequent call to the reset() method will reposition the stream at the last marked position so that subsequent reads will re-read the same bytes. The stream promises to allow readlimit bytes to be read before the mark position gets invalidated.
Parameters:
Overrides: java.io.FilterInputStream.mark(int)
public boolean markSupported()Reads a byte of data. This method will block if no input is available.
markSupported() returns a boolean indicating if this stream type supports mark/reset.
Overrides: java.io.FilterInputStream.markSupported()
public int read()This method returns the byte read, or -1 if the end of the stream is reached. If an I/O error occurrs, read() throws an IOException.
Overrides: java.io.FilterInputStream.read()
public int read(byte[] copyBuffer, int off, int len)Reads into an array of bytes. Blocks until some input is available.
This method returns the actual number of bytes read, or -1 returned when the end of the stream is reached. If an I/O error occurrs, this method throws an IOException.
Parameters:
Overrides: java.io.FilterInputStream.read(byte[], int, int)
public synchronized void reset()Repositions the stream to the last marked position. If the stream has not been marked, or if the mark has been invalidated, an IOException is thrown.
Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this is most easily done by invoking a general parser.
Overrides: java.io.FilterInputStream.reset()
public long skip(long n)Skips n bytes of input.
This method returns the actual number of bytes skipped. If an I/O error occurrs, it throws an IOException.
Parameters:
Overrides: java.io.FilterInputStream.skip(long)
public void unread()"Pushes" the given character back into the input buffer so the next read() will return it.