public class RandomAccessFileSeekableSource extends Object implements SeekableSource
| Constructor and Description |
|---|
RandomAccessFileSeekableSource(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(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(RandomAccessFile raf)
raf - public void seek(long pos)
throws IOException
SeekableSourceSeekableSource.read(ByteBuffer).seek in interface SeekableSourceIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic long length()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int read(ByteBuffer bb) throws 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 SeekableSourceIOException