Class PSTFile

java.lang.Object
io.github.jmcleodfoss.pst.PSTFile
Direct Known Subclasses:
PST

public class PSTFile
extends Object
The PSTFile class is a convenience container class used to read later data from the file.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    Header header
    The PST header, which contains encryption and file format information as well as other useful data.
  • Constructor Summary

    Constructors 
    Constructor Description
    PSTFile​(FileInputStream stream)
    Create a FileChannel for the given filename and read in the PST header.
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close the PSTFile file.
    static ByteBuffer makeByteBuffer​(byte[] bytes)
    Create a ByteBuffer with the right byte ordering from the given array.
    ByteBuffer read​(int position, int length)
    Read data from the given position as a ByteBuffer
    boolean unicode()
    A convenience method to indicate whether the PST file uses Unicode or ANSI encoding.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • header

      public final Header header
      The PST header, which contains encryption and file format information as well as other useful data.
  • Constructor Details

  • Method Details

    • read

      public ByteBuffer read​(int position, int length)
      Read data from the given position as a ByteBuffer
      Parameters:
      position - The location to read from.
      length - The number of bytes to read.
      Returns:
      A ByteBuffer providing access to the requested bytes
    • close

      public void close() throws IOException
      Close the PSTFile file.
      Throws:
      IOException - There was a problem closing the file.
    • unicode

      public boolean unicode()
      A convenience method to indicate whether the PST file uses Unicode or ANSI encoding.
      Returns:
      true if the PST file read in is a Unicode PST file, false if it is ANSI.
      See Also:
      FileFormat.fUnicode
    • makeByteBuffer

      public static ByteBuffer makeByteBuffer​(byte[] bytes)
      Create a ByteBuffer with the right byte ordering from the given array.
      Parameters:
      bytes - The data to change into a ByteBuffer
      Returns:
      A ByteBuffer containing the input data with little-endian order from which PST fields may be read.