Class PGPLiteralData

java.lang.Object
org.bouncycastle.openpgp.PGPLiteralData

public class PGPLiteralData extends Object
A single literal data packet in a PGP object stream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
    Format tag for binary literal data
    static final String
    The special name indicating a "for your eyes only" packet.
    static final char
    Format tag for MIME message bodies
    static final Date
    The special time for a modification time of "now" or the present time.
    static final char
    Format tag for textual literal data
    static final char
    Format tag for UTF-8 encoded textual literal data
  • Constructor Summary

    Constructors
    Constructor
    Description
    PGPLiteralData(byte[] encData)
    Construct a PGP LiteralData carrier from the passed in byte array.
    Construct a PGP LiteralData carrier from the passed in input stream.
    Construct a PGP LiteralData carrier from the passed in BCPG input stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the input stream representing the data stream.
    Return the file name associated with the data packet, decoded as UTF-8.
    int
    Return the format of the data packet.
    Return the raw input stream for the data packet.
    Return the modification time for the file (at second level precision).
    byte[]
    Return the file name as an uninterpreted (UTF-8 encoded) byte array.

    Methods inherited from class Object

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

    • BINARY

      public static final char BINARY
      Format tag for binary literal data
      See Also:
    • TEXT

      public static final char TEXT
      Format tag for textual literal data
      See Also:
    • UTF8

      public static final char UTF8
      Format tag for UTF-8 encoded textual literal data
      See Also:
    • MIME

      public static final char MIME
      Format tag for MIME message bodies
      See Also:
    • CONSOLE

      public static final String CONSOLE
      The special name indicating a "for your eyes only" packet.
      See Also:
    • NOW

      public static final Date NOW
      The special time for a modification time of "now" or the present time.
  • Constructor Details

    • PGPLiteralData

      public PGPLiteralData(byte[] encData) throws IOException
      Construct a PGP LiteralData carrier from the passed in byte array.
      Parameters:
      encData - an encoding of PGP literal data.
      Throws:
      IOException - if an error occurs reading from the PGP input.
    • PGPLiteralData

      public PGPLiteralData(InputStream inStream) throws IOException
      Construct a PGP LiteralData carrier from the passed in input stream.
      Parameters:
      inStream - an input stream containing an encoding of PGP literal data.
      Throws:
      IOException - if an error occurs reading from the PGP input.
    • PGPLiteralData

      public PGPLiteralData(BCPGInputStream pIn) throws IOException
      Construct a PGP LiteralData carrier from the passed in BCPG input stream.
      Parameters:
      pIn - a BCPG input stream containing an encoded PGP literal data structure.
      Throws:
      IOException - if an error occurs reading from the PGP input.
  • Method Details

    • getFormat

      public int getFormat()
      Return the format of the data packet. One of BINARY, TEXT, MIME or UTF8
    • getFileName

      public String getFileName()
      Return the file name associated with the data packet, decoded as UTF-8. A file name that is not valid UTF-8 has each malformed sequence decoded as U+FFFD rather than causing an exception; use getRawFileName() for the exact bytes.
    • getRawFileName

      public byte[] getRawFileName()
      Return the file name as an uninterpreted (UTF-8 encoded) byte array.
    • getModificationTime

      public Date getModificationTime()
      Return the modification time for the file (at second level precision).
    • getInputStream

      public InputStream getInputStream()
      Return the raw input stream for the data packet.
    • getDataStream

      public InputStream getDataStream()
      Return the input stream representing the data stream. Equivalent to getInputStream().