public class FileEncrypt extends FileBaseDefault
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_SIZE
The block size.
|
Constructor and Description |
---|
FileEncrypt(java.lang.String name,
byte[] encryptionKey,
java.nio.channels.FileChannel base) |
FileEncrypt(java.lang.String name,
FileEncrypt source,
java.nio.channels.FileChannel base) |
Modifier and Type | Method and Description |
---|---|
void |
force(boolean metaData) |
protected void |
implCloseChannel() |
protected void |
implTruncate(long newSize)
The truncate implementation.
|
int |
read(java.nio.ByteBuffer dst,
long position) |
long |
size() |
java.lang.String |
toString() |
java.nio.channels.FileLock |
tryLock(long position,
long size,
boolean shared) |
int |
write(java.nio.ByteBuffer src,
long position) |
position, position, read, truncate, write
lock, map, read, transferFrom, transferTo, write
begin, close, end, isOpen
public static final int BLOCK_SIZE
public FileEncrypt(java.lang.String name, byte[] encryptionKey, java.nio.channels.FileChannel base)
public FileEncrypt(java.lang.String name, FileEncrypt source, java.nio.channels.FileChannel base)
protected void implCloseChannel() throws java.io.IOException
implCloseChannel
in class FileBase
java.io.IOException
public int read(java.nio.ByteBuffer dst, long position) throws java.io.IOException
public int write(java.nio.ByteBuffer src, long position) throws java.io.IOException
public long size() throws java.io.IOException
size
in interface java.nio.channels.SeekableByteChannel
size
in class java.nio.channels.FileChannel
java.io.IOException
protected void implTruncate(long newSize) throws java.io.IOException
FileBaseDefault
implTruncate
in class FileBaseDefault
newSize
- the new sizejava.io.IOException
- on failurepublic void force(boolean metaData) throws java.io.IOException
public java.nio.channels.FileLock tryLock(long position, long size, boolean shared) throws java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object