Added encoding for attachments in PstParser.java

This commit is contained in:
Ann Priestman 2016-08-23 09:28:48 -04:00
parent 45e5088d45
commit bc73e91fa4

View File

@ -37,7 +37,9 @@ import org.sleuthkit.autopsy.ingest.IngestMonitor;
import org.sleuthkit.autopsy.ingest.IngestServices;
import static org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getRelModuleOutputPath;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.EncodedFileOutputStream;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData;
/**
* Parser for extracting emails from pst/ost Mircosoft Outlook data files.
@ -260,7 +262,8 @@ class PstParser {
* @throws PSTException
*/
private void saveAttachmentToDisk(PSTAttachment attach, String outPath) throws IOException, PSTException {
try (InputStream attachmentStream = attach.getFileInputStream(); FileOutputStream out = new FileOutputStream(outPath)) {
try (InputStream attachmentStream = attach.getFileInputStream();
EncodedFileOutputStream out = new EncodedFileOutputStream(new FileOutputStream(outPath), TskData.EncodingType.XOR1)) {
// 8176 is the block size used internally and should give the best performance
int bufferSize = 8176;
byte[] buffer = new byte[bufferSize];