class EncryptedLOBFile extends LOBFile
Modifier and Type | Field | Description |
---|---|---|
private int |
blockSize |
Block size for encryption.
|
private long |
currentPos |
Current file position.
|
private DataFactory |
df |
Factory object used for encryption and decryption.
|
private byte[] |
tail |
Leftover bytes.
|
private int |
tailSize |
Number of actual bytes in tail array.
|
Constructor | Description |
---|---|
EncryptedLOBFile(StorageFile lobFile,
DataFactory df) |
Constructs the EncryptedLOBFile object with encryption support.
|
Modifier and Type | Method | Description |
---|---|---|
private byte[] |
getBlocks(long pos,
int len) |
Find the blocks containing the data we are interested in.
|
(package private) long |
getFilePointer() |
Returns the currrent position in the file.
|
(package private) long |
length() |
Returns file length.
|
(package private) int |
read(byte[] buff,
int off,
int len) |
Reads len or remaining bytes in the file (whichever is lower) bytes
into buff starting from off position of the buffer.
|
(package private) int |
readByte() |
Reads one byte from file.
|
(package private) void |
seek(long pos) |
Sets the current file pointer to specific location.
|
(package private) void |
setLength(long size) |
Sets the file length to a given size.
|
(package private) void |
write(byte[] b) |
Write the buffer into file at current position.
|
(package private) void |
write(byte[] b,
int off,
int len) |
Writes length number of bytes from buffer starting from off position.
|
(package private) void |
write(int b) |
Writes one byte into the file.
|
close, getStorageFile
private final int blockSize
private final byte[] tail
private int tailSize
private long currentPos
private final DataFactory df
EncryptedLOBFile(StorageFile lobFile, DataFactory df) throws java.io.FileNotFoundException
lobFile
- StorageFile Object for which file will be createddf
- data factory for encryption and decriptionjava.io.FileNotFoundException
- if the file exists but is a directory or
cannot be openedprivate byte[] getBlocks(long pos, int len) throws java.io.IOException, StandardException
pos
- first position we are interested inlen
- number of bytes of interestjava.io.IOException
StandardException
long length() throws java.io.IOException
long getFilePointer()
getFilePointer
in class LOBFile
void seek(long pos) throws java.io.IOException
void write(int b) throws java.io.IOException, StandardException
write
in class LOBFile
b
- byte valuejava.io.IOException
- if disk operation failsStandardException
- if error occurred during encryption/decryptionvoid write(byte[] b, int off, int len) throws java.io.IOException, StandardException
write
in class LOBFile
b
- byte array containing bytes to be writtenoff
- starting offset of the byte array from where the
data should be written to the filelen
- number of bytes to be writtenjava.io.IOException
- if disk operation failsStandardException
- if error occurred during encryption/decryptionvoid write(byte[] b) throws java.io.IOException, StandardException
write
in class LOBFile
b
- byte array to be writtenjava.io.IOException
- if disk operation failsStandardException
- if error occurred during encryption/decryptionint readByte() throws java.io.IOException, StandardException
readByte
in class LOBFile
java.io.IOException
- if disk operation failsStandardException
- if error occurred during decryptionint read(byte[] buff, int off, int len) throws java.io.IOException, StandardException
read
in class LOBFile
buff
- byte array to fill read bytesoff
- offset of buff where the byte will be writtenlen
- number of bytes to be readjava.io.IOException
- if disk operation failsStandardException
- if error occurred during decryptionvoid setLength(long size) throws java.io.IOException, StandardException
setLength
in class LOBFile
size
- new file size. Must be lower than file length.java.io.IOException
- if file i/o failsStandardException
- if error occurred during decryptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.