Autopsy  4.16.0
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.textextractors.SqliteTextExtractor.SQLiteStreamReader Class Reference

Inherits Reader.

Classes

class  ExcessBytes
 

Public Member Functions

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 82 of file SqliteTextExtractor.java.

Member Function Documentation

void org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.close ( ) throws IOException
void org.sleuthkit.autopsy.textextractors.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 186 of file SqliteTextExtractor.java.

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

Consumer<String> org.sleuthkit.autopsy.textextractors.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 160 of file SqliteTextExtractor.java.

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

Consumer<Object> org.sleuthkit.autopsy.textextractors.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 122 of file SqliteTextExtractor.java.

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

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

Reads database values into the buffer. This function is responsible for getting the next table in the queue, initiating calls to the SQLiteTableReader, and filling in any excess bytes that are lingering from the previous call.

Exceptions
IOException

Definition at line 206 of file SqliteTextExtractor.java.

References org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.bufIndex, org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getColumnCount(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.getTableNames(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.isFinished(), and org.sleuthkit.autopsy.coreutils.SQLiteTableReader.read().

Member Data Documentation

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

Definition at line 90 of file SqliteTextExtractor.java.

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

Definition at line 88 of file SqliteTextExtractor.java.

final AbstractFile org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.file
private

Definition at line 85 of file SqliteTextExtractor.java.

ExcessBytes org.sleuthkit.autopsy.textextractors.SqliteTextExtractor.SQLiteStreamReader.leftOvers
private

Definition at line 91 of file SqliteTextExtractor.java.

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

Definition at line 84 of file SqliteTextExtractor.java.

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

Definition at line 87 of file SqliteTextExtractor.java.

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

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

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