Autopsy  4.9.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader Class Reference

Inherits Reader.

Classes

class  ExcessBytes
 

Public Member Functions

 SQLiteStreamReader (AbstractFile file)
 
void close () throws IOException
 
int read (char[] cbuf, int off, int len) throws IOException
 

Private Member Functions

void fillBuffer (String val)
 
Consumer< String > getColumnNameStrategy ()
 
Consumer< Object > getForAllTableValuesStrategy ()
 

Private Attributes

char[] buf
 
int bufIndex
 
String currentTableName
 
final AbstractFile file
 
ExcessBytes leftOvers
 
final SQLiteTableReader reader
 
Iterator< String > tableNames
 
int totalColumns
 

Detailed Description

Produces a continuous stream of characters from a database file. To achieve this, all table names are queues up and a SQLiteTableReader is used to do the actual queries and table iteration.

Definition at line 83 of file SqliteTextExtractor.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.SQLiteStreamReader ( AbstractFile  file)

Member Function Documentation

void org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.close ( ) throws IOException
void org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.fillBuffer ( String  val)
private

This functions writes the string representation of a database value into the read buffer. If the buffer becomes full, we save the extra characters and hold on to them until the next call to read().

Parameters
valFormatted database value string

Definition at line 187 of file SqliteTextExtractor.java.

Referenced by org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.getColumnNameStrategy(), and org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.getForAllTableValuesStrategy().

Consumer<String> org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.getColumnNameStrategy ( )
private

On every column name in the header do the following series of steps: 1) Write the tableName before the header. 2) Format the column name based on row positioning 3) Reset the count if we are at the end, that way if we want to read multiple tables we can do so without having to build new consumers.

columnIndex is purely for keeping track of where the column name is in the table, hence the bounds checking with the mod function.

Returns
Our consumer class defined to do the steps above.

Definition at line 161 of file SqliteTextExtractor.java.

References org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.fillBuffer(), and org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.totalColumns.

Referenced by org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.SQLiteStreamReader().

Consumer<Object> org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.getForAllTableValuesStrategy ( )
private

On every item in the database we want to do the following series of steps: 1) Get it's string representation (ignore blobs with empty string). 2) Format it based on its positioning in the row. 3) Write it to buffer

rowIndex is purely for keeping track of where the object is in the table, hence the bounds checking with the mod function.

Returns
Our consumer class defined to do the steps above.

Definition at line 123 of file SqliteTextExtractor.java.

References org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.fillBuffer(), and org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.totalColumns.

Referenced by org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.SQLiteStreamReader().

int org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.read ( char[]  cbuf,
int  off,
int  len 
) throws IOException

Member Data Documentation

char [] org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.buf
private

Definition at line 91 of file SqliteTextExtractor.java.

int org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.bufIndex
private
String org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.currentTableName
private

Definition at line 89 of file SqliteTextExtractor.java.

final AbstractFile org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.file
private
ExcessBytes org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.leftOvers
private

Definition at line 92 of file SqliteTextExtractor.java.

final SQLiteTableReader org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.reader
private

Definition at line 85 of file SqliteTextExtractor.java.

Iterator<String> org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.tableNames
private

Definition at line 88 of file SqliteTextExtractor.java.

int org.sleuthkit.autopsy.textreaders.SqliteTextExtractor.SQLiteStreamReader.totalColumns
private

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

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