public class SeekableReadOnlyFile extends java.lang.Object implements SeekableReadOnlyByteChannel
| Constructor and Description |
|---|
SeekableReadOnlyFile(java.io.File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this channel.
|
long |
getPosition() |
int |
read()
Read a single byte of data.
|
int |
read(byte[] buffer,
int off,
int count)
Read up to
count bytes to the specified buffer. |
int |
readFully(byte[] buffer,
int count)
Read exactly
count bytes to the specified buffer. |
void |
setPosition(long pos) |
public SeekableReadOnlyFile(java.io.File file)
throws java.io.FileNotFoundException
file - the filejava.io.FileNotFoundException - .public int readFully(byte[] buffer,
int count)
throws java.io.IOException
SeekableReadOnlyByteChannelcount bytes to the specified buffer.readFully in interface SeekableReadOnlyByteChannelbuffer - where to store the read datacount - how many bytes to readjava.io.IOException - .public void close()
throws java.io.IOException
SeekableReadOnlyByteChannelclose in interface SeekableReadOnlyByteChanneljava.io.IOException - .public long getPosition()
throws java.io.IOException
getPosition in interface SeekableReadOnlyByteChanneljava.io.IOException - .public void setPosition(long pos)
throws java.io.IOException
setPosition in interface SeekableReadOnlyByteChannelpos - the position in the channeljava.io.IOException - .public int read()
throws java.io.IOException
SeekableReadOnlyByteChannelread in interface SeekableReadOnlyByteChanneljava.io.IOException - .public int read(byte[] buffer,
int off,
int count)
throws java.io.IOException
SeekableReadOnlyByteChannelcount bytes to the specified buffer.read in interface SeekableReadOnlyByteChannelbuffer - .off - .count - .java.io.IOException - .