Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream Class Reference

Inherits InputStream.

Public Member Functions

int available () throws IOException
 
int read (byte[] b, int off, int len) throws IOException
 
int read () throws IOException
 
long skip (long n) throws IOException
 

Private Member Functions

 EnglishOnlyStream (Content content)
 
void appendResetTemp ()
 
int copyToReturn (byte[] b, int off, long len)
 

Private Attributes

int bytesInReadBuf = 0
 
final Content content
 
long contentOffset = 0
 
final byte[] curReadBuf = new byte[READ_BUF_SIZE]
 
StringBuilder curString = new StringBuilder()
 
int curStringLen = 0
 
boolean inString = false
 
boolean isEOF = false
 
final byte[] oneCharBuf = new byte[1]
 
int readBufOffset = 0
 
boolean stringAtBufBoundary = false
 
boolean stringAtTempBoundary = false
 
StringBuilder tempString = new StringBuilder()
 
int tempStringLen = 0
 

Static Private Attributes

static final Logger logger = Logger.getLogger(EnglishOnlyStream.class.getName())
 
static final int MIN_PRINTABLE_CHARS = 4
 
static final String NLS = Character.toString((char) 10)
 
static final int READ_BUF_SIZE = 65536
 

Detailed Description

Content input string stream reader/converter - given Content, extract strings from it and return encoded bytes via read()

Note: the utility supports extraction of only LATIN script and UTF8, UTF16LE, UTF16BE encodings and uses a brute force encoding detection - it's fast but could apply multiple encodings on the same string.

For other script/languages support and better encoding detection use AbstractFileStringIntStream streaming class, which wraps around StringExtract extractor.

Definition at line 151 of file StringsTextExtractor.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.EnglishOnlyStream ( Content  content)
private

Construct new string stream from Content. Do not attempt to fill entire read buffer if that would break a string

Parameters
contentContent object from which to extract strings.

Definition at line 182 of file StringsTextExtractor.java.

References org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.content.

Member Function Documentation

void org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.appendResetTemp ( )
private
int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.available ( ) throws IOException

Definition at line 352 of file StringsTextExtractor.java.

int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.copyToReturn ( byte[]  b,
int  off,
long  len 
)
private
int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.read ( byte[]  b,
int  off,
int  len 
) throws IOException
int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.read ( ) throws IOException

Definition at line 342 of file StringsTextExtractor.java.

long org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.skip ( long  n) throws IOException

Definition at line 358 of file StringsTextExtractor.java.

Member Data Documentation

int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.bytesInReadBuf = 0
private
final Content org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.content
private
long org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.contentOffset = 0
private

Definition at line 162 of file StringsTextExtractor.java.

final byte [] org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.curReadBuf = new byte[READ_BUF_SIZE]
private

Definition at line 163 of file StringsTextExtractor.java.

StringBuilder org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.curString = new StringBuilder()
private

Definition at line 166 of file StringsTextExtractor.java.

int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.curStringLen = 0
private
boolean org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.inString = false
private

Definition at line 173 of file StringsTextExtractor.java.

boolean org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.isEOF = false
private

Definition at line 170 of file StringsTextExtractor.java.

final Logger org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.logger = Logger.getLogger(EnglishOnlyStream.class.getName())
staticprivate

Definition at line 153 of file StringsTextExtractor.java.

final int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.MIN_PRINTABLE_CHARS = 4
staticprivate

Definition at line 156 of file StringsTextExtractor.java.

final String org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.NLS = Character.toString((char) 10)
staticprivate

Definition at line 154 of file StringsTextExtractor.java.

final byte [] org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.oneCharBuf = new byte[1]
private

Definition at line 174 of file StringsTextExtractor.java.

final int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.READ_BUF_SIZE = 65536
staticprivate

Definition at line 155 of file StringsTextExtractor.java.

int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.readBufOffset = 0
private

Definition at line 165 of file StringsTextExtractor.java.

boolean org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.stringAtBufBoundary = false
private

Definition at line 172 of file StringsTextExtractor.java.

boolean org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.stringAtTempBoundary = false
private

Definition at line 171 of file StringsTextExtractor.java.

StringBuilder org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.tempString = new StringBuilder()
private

Definition at line 168 of file StringsTextExtractor.java.

int org.sleuthkit.autopsy.keywordsearch.StringsTextExtractor.EnglishOnlyStream.tempStringLen = 0
private

The documentation for this class was generated from the following file:

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.