Package org.apache.poi.poifs.crypt.temp
Class EncryptedTempData
- java.lang.Object
-
- org.apache.poi.poifs.crypt.temp.EncryptedTempData
-
@Beta public class EncryptedTempData extends java.lang.Object
EncryptedTempData can be used to buffer binary data in a secure way, by using encrypted temp files.
-
-
Constructor Summary
Constructors Constructor Description EncryptedTempData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Removes the temporarily backing filelonggetByteCount()java.io.InputStreamgetInputStream()Returns the input stream for reading the previously written encrypted datajava.io.OutputStreamgetOutputStream()Returns the output stream for writing the data.
-
-
-
Method Detail
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOExceptionReturns the output stream for writing the data.Make sure to close it, otherwise the last cipher block is not written completely.
- Returns:
- the outputstream
- Throws:
java.io.IOException- if the writing to the underlying file fails
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionReturns the input stream for reading the previously written encrypted data- Returns:
- the inputstream
- Throws:
java.io.IOException- if the reading of the underlying file fails
-
getByteCount
public long getByteCount()
- Returns:
- number of bytes stored in the temp data file (the number you should expect after you decrypt the data)
-
dispose
public void dispose()
Removes the temporarily backing file
-
-