Package com.pff
Class PSTNodeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.pff.PSTNodeInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class PSTNodeInputStream extends java.io.InputStreamthis input stream basically "maps" an input stream on top of the random access file
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]allDataprivate intcurrentBlockprivate longcurrentLocationprivate booleanencryptedprivate java.io.RandomAccessFileinprivate java.util.LinkedList<OffsetIndexItem>indexItemsprivate longlengthprivate PSTFilepstFileprivate java.util.LinkedList<java.lang.Long>skipPointsprivate inttotalLoopCount
-
Constructor Summary
Constructors Constructor Description PSTNodeInputStream(PSTFile pstFile, byte[] attachmentData)PSTNodeInputStream(PSTFile pstFile, byte[] attachmentData, boolean encrypted)PSTNodeInputStream(PSTFile pstFile, OffsetIndexItem offsetItem)PSTNodeInputStream(PSTFile pstFile, PSTDescriptorItem descriptorItem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long[]getBlockOffsets()Get the offsets (block positions) used in the arrayprivate voidgetBlockSkipPoints(byte[] data)PSTFilegetPSTFile()booleanisEncrypted()longlength()private voidloadFromOffsetItem(OffsetIndexItem offsetItem)booleanmarkSupported()intread()intread(byte[] output)Read a block from the input stream.intread(byte[] output, int offset, int length)voidreset()voidseek(long location)longseekAndReadLong(long location, int bytes)
-
-
-
Field Detail
-
in
private java.io.RandomAccessFile in
-
pstFile
private PSTFile pstFile
-
skipPoints
private java.util.LinkedList<java.lang.Long> skipPoints
-
indexItems
private java.util.LinkedList<OffsetIndexItem> indexItems
-
currentBlock
private int currentBlock
-
currentLocation
private long currentLocation
-
allData
private byte[] allData
-
length
private long length
-
encrypted
private boolean encrypted
-
totalLoopCount
private int totalLoopCount
-
-
Constructor Detail
-
PSTNodeInputStream
PSTNodeInputStream(PSTFile pstFile, byte[] attachmentData)
-
PSTNodeInputStream
PSTNodeInputStream(PSTFile pstFile, byte[] attachmentData, boolean encrypted)
-
PSTNodeInputStream
PSTNodeInputStream(PSTFile pstFile, PSTDescriptorItem descriptorItem) throws java.io.IOException, PSTException
- Throws:
java.io.IOExceptionPSTException
-
PSTNodeInputStream
PSTNodeInputStream(PSTFile pstFile, OffsetIndexItem offsetItem) throws java.io.IOException, PSTException
- Throws:
java.io.IOExceptionPSTException
-
-
Method Detail
-
loadFromOffsetItem
private void loadFromOffsetItem(OffsetIndexItem offsetItem) throws java.io.IOException, PSTException
- Throws:
java.io.IOExceptionPSTException
-
isEncrypted
public boolean isEncrypted()
-
getBlockSkipPoints
private void getBlockSkipPoints(byte[] data) throws java.io.IOException, PSTException- Throws:
java.io.IOExceptionPSTException
-
length
public long length()
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] output) throws java.io.IOExceptionRead a block from the input stream. Recommended block size = 8176 (size used internally by PSTs)- Overrides:
readin classjava.io.InputStream- Parameters:
output-- Returns:
- Throws:
java.io.IOException
-
read
public int read(byte[] output, int offset, int length) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
reset
public void reset()
- Overrides:
resetin classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
getBlockOffsets
public java.lang.Long[] getBlockOffsets()
Get the offsets (block positions) used in the array- Returns:
-
seek
public void seek(long location) throws java.io.IOException, PSTException- Throws:
java.io.IOExceptionPSTException
-
seekAndReadLong
public long seekAndReadLong(long location, int bytes) throws java.io.IOException, PSTException- Throws:
java.io.IOExceptionPSTException
-
getPSTFile
public PSTFile getPSTFile()
-
-