| Modifier and Type | Field and Description |
|---|---|
| private final int | blockSize
Block size for encryption. |
| private long | currentPos
Current file position. |
| private final DataFactory | df
Factory object used for encryption and decryption. |
| private final byte[] | tail
Leftover bytes. |
| private int | tailSize
Number of actual bytes in tail array. |
| Access | Constructor and Description |
|---|---|
| pack-priv | EncryptedLOBFile(StorageFile
StorageFile Object for which file will be created lobFile, DataFactory data factory for encryption and decription df)Constructs the EncryptedLOBFile object with encryption support. |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | Returns: byte array containing all the blocks of data the specified region spans overfirst position we are interested in pos, int number of bytes of interest len)Find the blocks containing the data we are interested in. |
| pack-priv long | Returns: current position of file pointerOverrides org. Returns the currrent position in the file. |
| pack-priv long | Returns: file lengthOverrides org. Returns file length. |
| pack-priv int | Returns: number of bytes readbyte array to fill read bytes buff, int offset of buff where the byte will be written off, int number of bytes to be read len)Overrides org. Reads len or remaining bytes in the file (whichever is lower) bytes into buff starting from off position of the buffer. |
| pack-priv int | Returns: byteOverrides org. Reads one byte from file. |
| pack-priv void | seek(long
new position pos)Overrides org. Sets the current file pointer to specific location. |
| pack-priv void | setLength(long
new file size. Must be lower than file length. size)Overrides org. Sets the file length to a given size. |
| pack-priv void | write(int
byte value b)Overrides org. Writes one byte into the file. |
| pack-priv void | write(byte[]
byte array containing bytes to be written b, int starting offset of the byte array from where the
data should be written to the file off, int number of bytes to be written len)Overrides org. Writes length number of bytes from buffer starting from off position. |
| pack-priv void | write(byte[]
byte array to be written b)Overrides org. Write the buffer into file at current position. |
| blockSize | back to summary |
|---|---|
| private final int blockSize Block size for encryption. | |
| currentPos | back to summary |
|---|---|
| private long currentPos Current file position. | |
| df | back to summary |
|---|---|
| private final DataFactory df Factory object used for encryption and decryption. | |
| tail | back to summary |
|---|---|
| private final byte[] tail Leftover bytes. Stored in memory until they fill one block . | |
| tailSize | back to summary |
|---|---|
| private int tailSize Number of actual bytes in tail array. | |
| EncryptedLOBFile | back to summary |
|---|---|
| pack-priv EncryptedLOBFile(StorageFile lobFile, DataFactory df) throws FileNotFoundException Constructs the EncryptedLOBFile object with encryption support.
| |
| getBlocks | back to summary |
|---|---|
| private byte[] getBlocks(long pos, int len) throws IOException, StandardException Find the blocks containing the data we are interested in.
| |
| getFilePointer | back to summary |
|---|---|
| pack-priv long getFilePointer() Overrides org. Returns the currrent position in the file.
| |
| length | back to summary |
|---|---|
| pack-priv long length() throws IOException Overrides org. Returns file length.
| |
| read | back to summary |
|---|---|
| pack-priv int read(byte[] buff, int off, int len) throws IOException, StandardException Overrides org. Reads len or remaining bytes in the file (whichever is lower) bytes into buff starting from off position of the buffer.
| |
| readByte | back to summary |
|---|---|
| pack-priv int readByte() throws IOException, StandardException Overrides org. Reads one byte from file.
| |
| seek | back to summary |
|---|---|
| pack-priv void seek(long pos) throws IOException Overrides org. Sets the current file pointer to specific location.
| |
| setLength | back to summary |
|---|---|
| pack-priv void setLength(long size) throws IOException, StandardException Overrides org. Sets the file length to a given size. If the new size is smaller than the file length the file is truncated.
| |
| write | back to summary |
|---|---|
| pack-priv void write(int b) throws IOException, StandardException Overrides org. Writes one byte into the file.
| |
| write | back to summary |
|---|---|
| pack-priv void write(byte[] b, int off, int len) throws IOException, StandardException Overrides org. Writes length number of bytes from buffer starting from off position.
| |
| write | back to summary |
|---|---|
| pack-priv void write(byte[] b) throws IOException, StandardException Overrides org. Write the buffer into file at current position. It overwrites the data if current position is in the middle of the file and appends into the file if the total length exceeds the file size.
| |