public class EncryptedFileIO extends Object implements FileIO
FileIO that supports encryption(decryption) of pages written(readed) to(from) file.EncryptedFileIOFactory| 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.
|
void |
force(boolean withMetadata)
Forces any updates of this file to be written to the storage
device that contains it.
|
int |
getFileSystemBlockSize() |
long |
getSparseSize() |
MappedByteBuffer |
map(int sizeBytes)
Allocates memory mapped buffer for this file with given size.
|
long |
position()
Returns current file position.
|
void |
position(long newPosition)
Sets new current file position.
|
int |
punchHole(long position,
int len) |
int |
read(byte[] buf,
int off,
int len)
Reads a up to
length bytes from this file into the buffer. |
int |
read(ByteBuffer destBuf)
Reads a sequence of bytes from this file into the
destinationBuffer. |
int |
read(ByteBuffer destBuf,
long position)
Reads a sequence of bytes from this file into the
destinationBuffer
starting from specified file position. |
int |
readFully(byte[] buf,
int off,
int len)
Reads a up to
length bytes from this file into the buffer. |
int |
readFully(ByteBuffer destBuf)
Reads a sequence of bytes from this file into the
destinationBuffer. |
int |
readFully(ByteBuffer destBuf,
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.
|
int |
write(byte[] buf,
int off,
int len)
Writes
length bytes from the buffer
starting at offset off to this file. |
int |
write(ByteBuffer srcBuf)
Writes a sequence of bytes to this file from the
sourceBuffer. |
int |
write(ByteBuffer srcBuf,
long position)
Writes a sequence of bytes to this file from the
sourceBuffer
starting from specified file position |
int |
writeFully(byte[] buf,
int off,
int len)
Writes
length bytes from the buffer
starting at offset off to this file. |
int |
writeFully(ByteBuffer srcBuf)
Writes a sequence of bytes to this file from the
sourceBuffer. |
int |
writeFully(ByteBuffer srcBuf,
long position)
Writes a sequence of bytes to this file from the
sourceBuffer
starting from specified file position |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransferFrom, transferTopublic int getFileSystemBlockSize()
getFileSystemBlockSize in interface FileIOpublic long getSparseSize()
getSparseSize in interface FileIOFileIO.punchHole(long, int)public int punchHole(long position,
int len)
public long position()
throws IOException
position in interface FileIOIOException - If some I/O error occurs.public void position(long newPosition)
throws IOException
position in interface FileIOnewPosition - 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.public int read(ByteBuffer destBuf) throws IOException
destinationBuffer.read in interface FileIOdestBuf - Destination byte buffer.IOException - If some I/O error occurs.public int readFully(ByteBuffer destBuf) throws IOException
destinationBuffer.readFully in interface FileIOdestBuf - Destination byte buffer.IOException - If some I/O error occurs.public int read(ByteBuffer destBuf, long position) throws IOException
destinationBuffer
starting from specified file position.read in interface FileIOdestBuf - Destination byte buffer.position - Starting position of file.IOException - If some I/O error occurs.public int readFully(ByteBuffer destBuf, long position) throws IOException
destinationBuffer
starting from specified file position.readFully in interface FileIOdestBuf - Destination byte buffer.position - Starting position of file.IOException - If some I/O error occurs.public int read(byte[] buf,
int off,
int len)
throws IOException
length bytes from this file into the buffer.read in interface FileIObuf - Destination byte array.off - The start offset in array b
at which the data is written.len - Maximum number of bytes read.IOException - If some I/O error occurs.public int readFully(byte[] buf,
int off,
int len)
throws IOException
length bytes from this file into the buffer.readFully in interface FileIObuf - Destination byte array.off - The start offset in array b
at which the data is written.len - Number of bytes read.IOException - If some I/O error occurs.public int write(ByteBuffer srcBuf) throws IOException
sourceBuffer.write in interface FileIOsrcBuf - Source buffer.IOException - If some I/O error occurs.public int writeFully(ByteBuffer srcBuf) throws IOException
sourceBuffer.writeFully in interface FileIOsrcBuf - Source buffer.IOException - If some I/O error occurs.public int write(ByteBuffer srcBuf, long position) throws IOException
sourceBuffer
starting from specified file positionwrite in interface FileIOsrcBuf - Source buffer.position - Starting file position.IOException - If some I/O error occurs.public int writeFully(ByteBuffer srcBuf, long position) throws IOException
sourceBuffer
starting from specified file positionwriteFully in interface FileIOsrcBuf - Source buffer.position - Starting file position.IOException - If some I/O error occurs.public int write(byte[] buf,
int off,
int len)
throws IOException
length bytes from the buffer
starting at offset off to this file.write in interface FileIObuf - Source byte array.off - Start offset in the buffer.len - Number of bytes to write.IOException - If some I/O error occurs.public int writeFully(byte[] buf,
int off,
int len)
throws IOException
length bytes from the buffer
starting at offset off to this file.writeFully in interface FileIObuf - Source byte array.off - Start offset in the buffer.len - Number of bytes to write.IOException - If some I/O error occurs.public MappedByteBuffer map(int sizeBytes) throws IOException
map in interface FileIOsizeBytes - Size of buffer.IOException - If some I/O error occurs.public void force()
throws IOException
force in interface FileIOIOException - If some I/O error occurs.public void force(boolean withMetadata)
throws IOException
force in interface FileIOwithMetadata - If true force also file metadata.IOException - If some I/O error occurs.public long size()
throws IOException
size in interface FileIOIOException - If some I/O error occurs.public void clear()
throws IOException
clear in interface FileIOIOException - If some I/O error occurs.public void close()
throws IOException
close in interface AutoCloseableclose in interface FileIOIOException - If some I/O error occurs.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020