| java.lang.Object java.io.InputStream com.quadcap.sql.file.RandomAccessInputStream
RandomAccessInputStream | public class RandomAccessInputStream extends InputStream (Code) | | An input stream attached to a RandomAccess object.
author: Stan Bailes |
Method Summary | |
public int | available() Returns the number of bytes that can be read from this input
stream without blocking. | public void | close() Closes this input stream and releases any system resources
associated with the stream. | public int | getPosition() | public int | read() Reads the next byte of data from this input stream. | public int | read(byte b, int off, int len) Reads up to len bytes of data from this input stream
into an array of bytes. | public void | setPosition(int p) | public long | skip(long n) Skips over and discards n bytes of data from this
input stream. |
available | public int available() throws IOException(Code) | | Returns the number of bytes that can be read from this input
stream without blocking. The available method of
InputStream returns 0 . This method
should be overridden by subclasses.
the number of bytes that can be read from this input streamwithout blocking. exception: IOException - if an I/O error occurs. |
close | public void close() throws IOException(Code) | | Closes this input stream and releases any system resources
associated with the stream.
exception: IOException - if an I/O error occurs. |
getPosition | public int getPosition()(Code) | | |
read | public int read() throws IOException(Code) | | Reads the next byte of data from this input stream. The value
byte is returned as an int in the range
0 to 255 . If no byte is available
because the end of the stream has been reached, the value
-1 is returned.
the next byte of data, or -1 if the end of thestream is reached. exception: IOException - if an I/O error occurs. |
read | public int read(byte b, int off, int len) throws IOException(Code) | | Reads up to len bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available. If the first argument is null, up to
len bytes are read and discarded.
Parameters: b - the buffer into which the data is read. Parameters: off - the start offset of the data. Parameters: len - the maximum number of bytes read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. |
setPosition | public void setPosition(int p)(Code) | | |
skip | public long skip(long n) throws IOException(Code) | | Skips over and discards n bytes of data from this
input stream. The skip method may, for a variety of
reasons, end up skipping over some smaller number of bytes,
possibly 0 . The actual number of bytes skipped is
returned.
The skip method of InputStream creates
a byte array of length n and then reads into it until
n bytes have been read or the end of the stream has
been reached. Subclasses are encouraged to provide a more
efficient implementation of this method.
Parameters: n - the number of bytes to be skipped. the actual number of bytes skipped. exception: IOException - if an I/O error occurs. since: JDK1.0 |
|
|