public interface Handle
FileSystem
.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the handle.
|
long |
length()
The total length of the file.
|
long |
position()
The current position in the file.
|
int |
read(byte[] into)
Tries to read as much data from the file as fits into the specified
array.
|
long |
seek(long to)
Jump to the specified position in the file, if possible.
|
void |
write(byte[] value)
Tries to write all the data from the specified array into the file.
|
long position()
long length()
void close()
read(byte[])
or write(byte[])
should throw
an IOException after this function was called.int read(byte[] into) throws java.io.IOException
into
- the buffer to read the data into.java.io.IOException
- if the file was opened in writing mode or an
I/O error occurred or the file was already
closed.long seek(long to) throws java.io.IOException
to
- the position in the file to jump to.java.io.IOException
- if the file was opened in write mode.void write(byte[] value) throws java.io.IOException
value
- the data to write into the file.java.io.IOException
- if the file was opened in read-only mode, or
another I/O error occurred (no more space,
for example), or the file was already closed.