public class RAFInputStream extends InputStream
| Constructor and Description |
|---|
RAFInputStream(RandomAccessFile raf)
Constructor with default buffer size.
|
RAFInputStream(RandomAccessFile raf,
int bufferSize)
Constructor with buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or
skipped over) from this input stream without blocking.
|
long |
getFilePos()
Returns the current position in the file.
|
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,
invalidating the buffer.
|
long |
skip(long n)
Skips some number of bytes.
|
close, mark, markSupported, resetpublic RAFInputStream(RandomAccessFile raf)
raf - the file on which the stream is to be based.public RAFInputStream(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 IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStream0
when it reaches the end of the input stream.IOExceptionpublic RandomAccessFile getRAF()
public void seek(long offset)
throws IOException
IOExceptionpublic long getFilePos()
throws IOException
IOExceptionCopyright © 2008–2018 The Open Preservation Foundation. All rights reserved.