public class RandomAccessFileSeekableSource extends java.lang.Object implements SeekableSource
| Modifier and Type | Field and Description |
|---|---|
private java.io.RandomAccessFile |
raf |
| Constructor and Description |
|---|
RandomAccessFileSeekableSource(java.io.RandomAccessFile raf)
Constructs a new RandomAccessFileSeekableSource.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
length() |
int |
read(byte[] b,
int off,
int len) |
int |
read(java.nio.ByteBuffer bb)
Reads up to
Buffer.remaining() bytes from the source,
returning the number of bytes read, or -1 if no bytes were read
and EOF was reached. |
void |
seek(long pos)
Sets the position for the next
SeekableSource.read(ByteBuffer). |
public RandomAccessFileSeekableSource(java.io.RandomAccessFile raf)
raf - public void seek(long pos)
throws java.io.IOException
SeekableSourceSeekableSource.read(ByteBuffer).seek in interface SeekableSourcejava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic long length()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic int read(java.nio.ByteBuffer bb)
throws java.io.IOException
SeekableSourceBuffer.remaining() bytes from the source,
returning the number of bytes read, or -1 if no bytes were read
and EOF was reached.read in interface SeekableSourcejava.io.IOException