public interface FileIO extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Truncates current file to zero length
and resets current file position to zero.
|
void |
close()
Closes current file.
|
void |
force()
Forces any updates of this file to be written to the storage
device that contains it.
|
long |
position()
Returns current file position.
|
void |
position(long newPosition)
Sets new current file position.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads a up to
length bytes from this file into the buffer. |
int |
read(ByteBuffer destinationBuffer)
Reads a sequence of bytes from this file into the
destinationBuffer. |
int |
read(ByteBuffer destinationBuffer,
long position)
Reads a sequence of bytes from this file into the
destinationBuffer
starting from specified file position. |
long |
size()
Returns current file size in bytes.
|
void |
write(byte[] buffer,
int offset,
int length)
Writes
length bytes from the buffer
starting at offset off to this file. |
int |
write(ByteBuffer sourceBuffer)
Writes a sequence of bytes to this file from the
sourceBuffer. |
int |
write(ByteBuffer sourceBuffer,
long position)
Writes a sequence of bytes to this file from the
sourceBuffer
starting from specified file position |
long position()
throws IOException
IOException - If some I/O error occurs.void position(long newPosition)
throws IOException
newPosition - The new position, a non-negative integer counting
the number of bytes from the beginning of the file.IOException - If some I/O error occurs.int read(ByteBuffer destinationBuffer) throws IOException
destinationBuffer.destinationBuffer - Destination byte buffer.IOException - If some I/O error occurs.int read(ByteBuffer destinationBuffer, long position) throws IOException
destinationBuffer
starting from specified file position.destinationBuffer - Destination byte buffer.position - Starting position of file.IOException - If some I/O error occurs.int read(byte[] buffer,
int offset,
int length)
throws IOException
length bytes from this file into the buffer.buffer - Destination byte array.offset - The start offset in array b
at which the data is written.length - Maximum number of bytes read.IOException - If some I/O error occurs.int write(ByteBuffer sourceBuffer) throws IOException
sourceBuffer.sourceBuffer - Source buffer.IOException - If some I/O error occurs.int write(ByteBuffer sourceBuffer, long position) throws IOException
sourceBuffer
starting from specified file positionsourceBuffer - Source buffer.position - Starting file position.IOException - If some I/O error occurs.void write(byte[] buffer,
int offset,
int length)
throws IOException
length bytes from the buffer
starting at offset off to this file.buffer - Source byte array.offset - Start offset in the buffer.length - Number of bytes to write.IOException - If some I/O error occurs.void force()
throws IOException
IOException - If some I/O error occurs.long size()
throws IOException
IOException - If some I/O error occurs.void clear()
throws IOException
IOException - If some I/O error occurs.void close()
throws IOException
close in interface AutoCloseableIOException - If some I/O error occurs.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.1.0 Release Date : July 20 2017