public class RandomAccessFileSeekableSource extends java.lang.Object implements SeekableSource
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
SeekableSource
SeekableSource.read(ByteBuffer)
.seek
in interface SeekableSource
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public long length() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public int read(java.nio.ByteBuffer bb) throws java.io.IOException
SeekableSource
Buffer.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 SeekableSource
java.io.IOException