Class BCPGOutputStream

java.lang.Object
java.io.OutputStream
org.bouncycastle.bcpg.BCPGOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, CompressionAlgorithmTags, PacketTags

public class BCPGOutputStream extends OutputStream implements PacketTags, CompressionAlgorithmTags
Basic output stream.
  • Constructor Details

    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out)
      Base constructor - generate a PGP protocol encoding with old-style packets whenever there is an alternative for backwards compatibility.
      Parameters:
      out - output stream to write encoded data to.
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, boolean newFormatOnly)
      Base constructor specifying whether to use packets in the new format wherever possible.
      Parameters:
      out - output stream to write encoded data to.
      newFormatOnly - true if use new format packets, false if backwards compatible preferred.
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, PacketFormat packetFormat)
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, int tag) throws IOException
      Create a stream representing an old style partial object.
      Parameters:
      tag - the packet tag for the object.
      Throws:
      IOException
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, int tag, long length, boolean oldFormat) throws IOException
      Create a stream representing a general packet.
      Parameters:
      out -
      tag -
      length -
      oldFormat -
      Throws:
      IOException
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, int tag, long length) throws IOException
      Parameters:
      tag -
      length -
      Throws:
      IOException
    • BCPGOutputStream

      public BCPGOutputStream(OutputStream out, int tag, byte[] buffer) throws IOException
      Create a new style partial input stream buffered into chunks.
      Parameters:
      out - output stream to write to.
      tag - packet tag.
      buffer - size of chunks making up the packet.
      Throws:
      IOException
  • Method Details