@Internal public abstract class ChunkedCipherOutputStream extends java.io.FilterOutputStream
| Constructor and Description |
|---|
ChunkedCipherOutputStream(DirectoryNode dir,
int chunkSize) |
ChunkedCipherOutputStream(java.io.OutputStream stream,
int chunkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
calculateChecksum(java.io.File fileOut,
int oleStreamSize) |
void |
close() |
protected abstract void |
createEncryptionInfoEntry(DirectoryNode dir,
java.io.File tmpFile) |
protected byte[] |
getChunk() |
protected int |
getChunkMask() |
protected com.zaxxer.sparsebits.SparseBitSet |
getPlainByteFlags() |
protected long |
getPos() |
protected long |
getTotalPos() |
protected abstract javax.crypto.Cipher |
initCipherForBlock(javax.crypto.Cipher existing,
int block,
boolean lastChunk) |
javax.crypto.Cipher |
initCipherForBlock(int block,
boolean lastChunk) |
protected javax.crypto.Cipher |
initCipherForBlockNoFlush(javax.crypto.Cipher existing,
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) |
public ChunkedCipherOutputStream(DirectoryNode dir, int chunkSize) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionpublic ChunkedCipherOutputStream(java.io.OutputStream stream,
int chunkSize)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionpublic final javax.crypto.Cipher initCipherForBlock(int block,
boolean lastChunk)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityException@Internal protected javax.crypto.Cipher initCipherForBlockNoFlush(javax.crypto.Cipher existing, int block, boolean lastChunk) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionprotected abstract javax.crypto.Cipher initCipherForBlock(javax.crypto.Cipher existing,
int block,
boolean lastChunk)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionprotected abstract void calculateChecksum(java.io.File fileOut,
int oleStreamSize)
throws java.security.GeneralSecurityException,
java.io.IOException
java.security.GeneralSecurityExceptionjava.io.IOExceptionprotected abstract void createEncryptionInfoEntry(DirectoryNode dir, java.io.File tmpFile) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void writePlain(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionprotected void write(byte[] b,
int off,
int len,
boolean writePlain)
throws java.io.IOException
java.io.IOExceptionprotected int getChunkMask()
protected void writeChunk(boolean continued)
throws java.io.IOException
java.io.IOExceptionprotected int invokeCipher(int posInChunk,
boolean doFinal)
throws java.security.GeneralSecurityException,
java.io.IOException
java.security.GeneralSecurityExceptionjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterOutputStreamjava.io.IOExceptionprotected byte[] getChunk()
protected com.zaxxer.sparsebits.SparseBitSet 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 2022 The Apache Software Foundation or its licensors, as applicable.