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 |
---|---|
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.
|
long |
skip(long n)
Skips some number of bytes.
|
available, close, mark, markSupported, reset
public 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 InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public RandomAccessFile getRAF()
public void seek(long offset) throws IOException
IOException
public long getFilePos() throws IOException
IOException
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.