Class SeekableReadOnlyFile
java.lang.Object
com.github.junrar.io.SeekableReadOnlyFile
- All Implemented Interfaces:
SeekableReadOnlyByteChannel
DOCUMENT ME
- Version:
- $LastChangedRevision$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this channel.longintread()Read a single byte of data.intread(byte[] buffer, int off, int count) Read up tocountbytes to the specified buffer.intreadFully(byte[] buffer, int count) Read exactlycountbytes to the specified buffer.voidsetPosition(long pos)
-
Field Details
-
file
-
-
Constructor Details
-
SeekableReadOnlyFile
- Parameters:
file- the file- Throws:
FileNotFoundException- .
-
-
Method Details
-
readFully
Description copied from interface:SeekableReadOnlyByteChannelRead exactlycountbytes to the specified buffer.- Specified by:
readFullyin interfaceSeekableReadOnlyByteChannel- Parameters:
buffer- where to store the read datacount- how many bytes to read- Returns:
- bytes read || -1 if IO problem
- Throws:
IOException- .
-
close
Description copied from interface:SeekableReadOnlyByteChannelClose this channel.- Specified by:
closein interfaceSeekableReadOnlyByteChannel- Throws:
IOException- .
-
getPosition
- Specified by:
getPositionin interfaceSeekableReadOnlyByteChannel- Returns:
- the current position in the channel
- Throws:
IOException- .
-
setPosition
- Specified by:
setPositionin interfaceSeekableReadOnlyByteChannel- Parameters:
pos- the position in the channel- Throws:
IOException- .
-
read
Description copied from interface:SeekableReadOnlyByteChannelRead a single byte of data.- Specified by:
readin interfaceSeekableReadOnlyByteChannel- Returns:
- read read
- Throws:
IOException- .
-
read
Description copied from interface:SeekableReadOnlyByteChannelRead up tocountbytes to the specified buffer.- Specified by:
readin interfaceSeekableReadOnlyByteChannel- Parameters:
buffer- .off- .count- .- Returns:
- read read
- Throws:
IOException- .
-