Class ChunkedCipherOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.docx4j.org.apache.poi.poifs.crypt.ChunkedCipherOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
BinaryRC4Encryptor.BinaryRC4CipherOutputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprotected final intFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcalculateChecksum(File fileOut, int oleStreamSize) voidclose()protected abstract voidcreateEncryptionInfoEntry(DirectoryNode dir, File tmpFile) protected abstract CipherinitCipherForBlock(Cipher existing, int block, boolean lastChunk) voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) protected voidMethods inherited from class java.io.FilterOutputStream
flushMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
chunkSize
protected final int chunkSize -
chunkMask
protected final int chunkMask -
chunkBits
protected final int chunkBits
-
-
Constructor Details
-
ChunkedCipherOutputStream
public ChunkedCipherOutputStream(DirectoryNode dir, int chunkSize) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
-
Method Details
-
initCipherForBlock
protected abstract Cipher initCipherForBlock(Cipher existing, int block, boolean lastChunk) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
calculateChecksum
protected abstract void calculateChecksum(File fileOut, int oleStreamSize) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
createEncryptionInfoEntry
protected abstract void createEncryptionInfoEntry(DirectoryNode dir, File tmpFile) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
writeChunk
- Throws:
IOExceptionGeneralSecurityException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-