public class RAFInputStream
extends java.io.InputStream
| Constructor and Description |
|---|
RAFInputStream(java.io.RandomAccessFile raf)
Constructor with default buffer size.
|
RAFInputStream(java.io.RandomAccessFile raf,
int bufferSize)
Constructor with buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getFilePos()
Returns the current position in the file.
|
java.io.RandomAccessFile |
getRAF()
Returns the RandomAccessFile object.
|
int |
read()
Reads a single byte from the file.
|
int |
read(byte[] b)
Reads some number of bytes from the input stream and
stores them into the buffer array b.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream
into an array of bytes.
|
void |
seek(long offset)
Positions the stream to a different point in the file.
|
long |
skip(long n)
Skips some number of bytes.
|
public RAFInputStream(java.io.RandomAccessFile raf)
raf - The file on which the
stream is to be based.public RAFInputStream(java.io.RandomAccessFile raf,
int bufferSize)
raf - The file on which the
stream is to be based.bufferSize - The buffer size to be used.
If less than or equal to 0, the
default buffer size is used.public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic java.io.RandomAccessFile getRAF()
public void seek(long offset)
throws java.io.IOException
java.io.IOExceptionpublic long getFilePos()
throws java.io.IOException
java.io.IOException