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.InputStream
this input stream basically "maps" an input stream on top of the random access file
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
allData
private int
currentBlock
private long
currentLocation
private boolean
encrypted
private java.io.RandomAccessFile
in
private java.util.LinkedList<OffsetIndexItem>
indexItems
private long
length
private PSTFile
pstFile
private java.util.LinkedList<java.lang.Long>
skipPoints
private int
totalLoopCount
-
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 void
getBlockSkipPoints(byte[] data)
PSTFile
getPSTFile()
boolean
isEncrypted()
long
length()
private void
loadFromOffsetItem(OffsetIndexItem offsetItem)
boolean
markSupported()
int
read()
int
read(byte[] output)
Read a block from the input stream.int
read(byte[] output, int offset, int length)
void
reset()
void
seek(long location)
long
seekAndReadLong(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.IOException
PSTException
-
PSTNodeInputStream
PSTNodeInputStream(PSTFile pstFile, OffsetIndexItem offsetItem) throws java.io.IOException, PSTException
- Throws:
java.io.IOException
PSTException
-
-
Method Detail
-
loadFromOffsetItem
private void loadFromOffsetItem(OffsetIndexItem offsetItem) throws java.io.IOException, PSTException
- Throws:
java.io.IOException
PSTException
-
isEncrypted
public boolean isEncrypted()
-
getBlockSkipPoints
private void getBlockSkipPoints(byte[] data) throws java.io.IOException, PSTException
- Throws:
java.io.IOException
PSTException
-
length
public long length()
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] output) throws java.io.IOException
Read a block from the input stream. Recommended block size = 8176 (size used internally by PSTs)- Overrides:
read
in 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:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
reset
public void reset()
- Overrides:
reset
in classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in 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.IOException
PSTException
-
seekAndReadLong
public long seekAndReadLong(long location, int bytes) throws java.io.IOException, PSTException
- Throws:
java.io.IOException
PSTException
-
getPSTFile
public PSTFile getPSTFile()
-
-