@Internal public abstract class ChunkedCipherOutputStream extends FilterOutputStream
out| Constructor and Description |
|---|
ChunkedCipherOutputStream(DirectoryNode dir,
int chunkSize) |
ChunkedCipherOutputStream(OutputStream stream,
int chunkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
calculateChecksum(File fileOut,
int oleStreamSize) |
void |
close() |
protected abstract void |
createEncryptionInfoEntry(DirectoryNode dir,
File tmpFile) |
protected byte[] |
getChunk() |
protected int |
getChunkMask() |
protected BitSet |
getPlainByteFlags() |
protected long |
getPos() |
protected long |
getTotalPos() |
protected abstract Cipher |
initCipherForBlock(Cipher existing,
int block,
boolean lastChunk) |
Cipher |
initCipherForBlock(int block,
boolean lastChunk) |
protected int |
invokeCipher(int posInChunk,
boolean doFinal)
Helper function for overriding the cipher invocation, i.e.
|
void |
setNextRecordSize(int recordSize,
boolean isPlain)
Some ciphers (actually just XOR) are based on the record size,
which needs to be set before encryption
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
protected void |
write(byte[] b,
int off,
int len,
boolean writePlain) |
void |
write(int b) |
protected void |
writeChunk(boolean continued) |
void |
writePlain(byte[] b,
int off,
int len) |
flushpublic ChunkedCipherOutputStream(DirectoryNode dir, int chunkSize) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic ChunkedCipherOutputStream(OutputStream stream, int chunkSize) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic final Cipher initCipherForBlock(int block, boolean lastChunk) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected abstract Cipher initCipherForBlock(Cipher existing, int block, boolean lastChunk) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected abstract void calculateChecksum(File fileOut, int oleStreamSize) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionprotected abstract void createEncryptionInfoEntry(DirectoryNode dir, File tmpFile) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic void write(int b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void writePlain(byte[] b,
int off,
int len)
throws IOException
IOExceptionprotected void write(byte[] b,
int off,
int len,
boolean writePlain)
throws IOException
IOExceptionprotected int getChunkMask()
protected void writeChunk(boolean continued)
throws IOException
IOExceptionprotected int invokeCipher(int posInChunk,
boolean doFinal)
throws GeneralSecurityException
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionprotected byte[] getChunk()
protected BitSet getPlainByteFlags()
protected long getPos()
protected long getTotalPos()
public void setNextRecordSize(int recordSize,
boolean isPlain)
recordSize - the size of the next recordisPlain - true if the record is unencryptedCopyright 2018 The Apache Software Foundation or its licensors, as applicable.