19 package org.sleuthkit.autopsy.textextractors;
21 import java.io.BufferedInputStream;
22 import java.io.IOException;
23 import java.io.InputStreamReader;
24 import java.io.Reader;
25 import java.nio.charset.Charset;
26 import java.nio.charset.StandardCharsets;
27 import java.util.logging.Level;
40 private final AbstractFile
file;
55 if(encoding == null) {
59 encoding = StandardCharsets.UTF_8;
61 }
catch (TskCoreException | IOException ex) {
62 logger.log(Level.SEVERE, String.format(
"Error detecting the "
63 +
"encoding for %s (objID=%d)", file.getName(), file.getId()), ex);
64 encoding = StandardCharsets.UTF_8;
72 return new InputStreamReader(
new BufferedInputStream(
new ReadContentInputStream(file)), encoding);
77 return file.getMIMEType().equals(
"text/plain");
static final Charset UNKNOWN_CHARSET
static Charset getEncoding(AbstractFile file)
synchronized static Logger getLogger(String name)