PGPCanonicalizedDataGenerator is used by invoking one of the open functions to create an OutputStream that raw data can be supplied to for encoding:
open(OutputStream, char, String, Date) to create a packet containing a single
literal data object.open(OutputStream, char, String, Date, byte[]) to create a packet consisting of a series
of literal data objects (partials).
A PGPCanonicalizedDataGenerator is usually used to wrap the OutputStream
obtained from a
PGPEncryptedDataGenerator or a PGPCompressedDataGenerator.
Once literal data has been written to the constructed OutputStream, writing of the object stream
is completed by closing the OutputStream obtained from the open() method, or
equivalently invoking close() on this generator.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CONSOLE
The special name indicating a "for your eyes only" packet. |
| private PGPLiteralDataGenerator | |
| public static final Date | NOW
The special time for a modification time of "now" or the present time. |
| private boolean | |
| public static final char | TEXT
Format tag for textual literal data |
| public static final char | UTF8
Format tag for UTF-8 encoded textual literal data |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PGPCanonicalizedDataGenerator(boolean
true to use PGP 2.6.x compatible format.Constructs a generator for literal data objects, specifying to use new or old (PGP 2.6.x compatible) format. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements org. Close the literal data packet - this is equivalent to calling close on the stream returned by the open() method. |
| public OutputStream | open(OutputStream
the underlying output stream to write the literal data packet to. out, char format, String the name of the "file" to encode in the literal data object. name, Date the time of last modification we want stored. modificationTime)Open a literal data packet, returning a stream to store the data inside the packet. |
| public OutputStream | open(OutputStream
the underlying output stream to write the literal data packet to. out, char format, String the name of the "file" to encode in the literal data object. name, Date the time of last modification we want stored. modificationTime, File backingFile)Open a literal data packet, returning a stream to store the data inside the packet. |
| public OutputStream | Returns: the output stream to write data to.the underlying output stream to write the literal data packet to. out, char format, String the name of the "file" to encode in the literal data object. name, Date the time of last modification we want stored (will be stored to
second level precision). modificationTime, byte[] a buffer to use to buffer and write partial packets. The returned stream takes
ownership of the buffer. buffer)Open a literal data packet, returning a stream to store the data inside the packet as an indefinite-length stream. |
| public OutputStream | Returns: the output stream to write data to.the underlying output stream to write the literal data packet to. out, char format, File the file to determine the filename from. file)Open a literal data packet for the passed in File object, returning an output stream for saving the file contents. |
| CONSOLE | back to summary |
|---|---|
| public static final String CONSOLE The special name indicating a "for your eyes only" packet. | |
| lGen | back to summary |
|---|---|
| private PGPLiteralDataGenerator lGen | |
| NOW | back to summary |
|---|---|
| public static final Date NOW The special time for a modification time of "now" or the present time. | |
| oldFormat | back to summary |
|---|---|
| private boolean oldFormat | |
| TEXT | back to summary |
|---|---|
| public static final char TEXT Format tag for textual literal data | |
| UTF8 | back to summary |
|---|---|
| public static final char UTF8 Format tag for UTF-8 encoded textual literal data | |
| PGPCanonicalizedDataGenerator | back to summary |
|---|---|
| public PGPCanonicalizedDataGenerator() Constructs a generator for literal data objects. | |
| PGPCanonicalizedDataGenerator | back to summary |
|---|---|
| public PGPCanonicalizedDataGenerator(boolean oldFormat) Constructs a generator for literal data objects, specifying to use new or old (PGP 2.6.x compatible) format. This can be used for compatibility with PGP 2.6.x.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements org. Close the literal data packet - this is equivalent to calling close on the stream returned by the open() method. | |
| open | back to summary |
|---|---|
| public OutputStream open(OutputStream out, char format, String name, Date modificationTime) throws IOException Open a literal data packet, returning a stream to store the data inside the packet. The stream created can be closed off by either calling close() on the stream or close() on the generator. Closing the returned stream does not close off the OutputStream parameter out.
| |
| open | back to summary |
|---|---|
| public OutputStream open(OutputStream out, char format, String name, Date modificationTime, File backingFile) throws IOException Open a literal data packet, returning a stream to store the data inside the packet. The stream created can be closed off by either calling close() on the stream or close() on the generator. Closing the returned stream does not close off the OutputStream parameter out.
| |
| open | back to summary |
|---|---|
| public OutputStream open(OutputStream out, char format, String name, Date modificationTime, byte[] buffer) throws IOException Open a literal data packet, returning a stream to store the data inside the packet as an indefinite-length stream. The stream is written out as a series of partial packets with a chunk size determined by the size of the passed in buffer. The stream created can be closed off by either calling close() on the stream or close() on the generator. Closing the returned stream does not close off the OutputStream parameter out. Note if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.
| |
| open | back to summary |
|---|---|
| public OutputStream open(OutputStream out, char format, File file) throws IOException Open a literal data packet for the passed in File object, returning an output stream for saving the file contents. This method configures the generator to store the file contents in a single literal data packet, taking the filename and modification time from the file, but does not store the actual file data. The stream created can be closed off by either calling close() on the stream or close() on the generator. Closing the returned stream does not close off the OutputStream parameter out.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final char | |
| private final PGPLiteralDataGenerator | |
| private final Date | |
| private final String | |
| private final OutputStream |
| Access | Constructor and Description |
|---|---|
| public | ArrayCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| format | back to summary |
|---|---|
| private final char format | |
| lGen | back to summary |
|---|---|
| private final PGPLiteralDataGenerator lGen | |
| modificationTime | back to summary |
|---|---|
| private final Date modificationTime | |
| name | back to summary |
|---|---|
| private final String name | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| ArrayCRLFGeneratorStream | back to summary |
|---|---|
| public ArrayCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides org. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| protected final OutputStream | |
| private final boolean | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| crlfOut | back to summary |
|---|---|
| protected final OutputStream crlfOut | |
| isBinary | back to summary |
|---|---|
| private final boolean isBinary | |
| lastB | back to summary |
|---|---|
| private int lastB | |
| CRLFGeneratorStream | back to summary |
|---|---|
| public CRLFGeneratorStream(OutputStream crlfOut, boolean isBinary) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public byte[] |
| ErasableOutputStream | back to summary |
|---|---|
| public ErasableOutputStream() | |
| Modifier and Type | Field and Description |
|---|---|
| private final File | |
| private final char | |
| private final PGPLiteralDataGenerator | |
| private final Date | |
| private final String | |
| private final OutputStream |
| Access | Constructor and Description |
|---|---|
| public | FileCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime, File backingFile)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| backingFile | back to summary |
|---|---|
| private final File backingFile | |
| format | back to summary |
|---|---|
| private final char format | |
| lGen | back to summary |
|---|---|
| private final PGPLiteralDataGenerator lGen | |
| modificationTime | back to summary |
|---|---|
| private final Date modificationTime | |
| name | back to summary |
|---|---|
| private final String name | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| FileCRLFGeneratorStream | back to summary |
|---|---|
| public FileCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime, File backingFile) throws FileNotFoundException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides org. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| Access | Constructor and Description |
|---|---|
| public | IndefiniteCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime, byte[] buffer)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| IndefiniteCRLFGeneratorStream | back to summary |
|---|---|
| public IndefiniteCRLFGeneratorStream(OutputStream out, PGPLiteralDataGenerator sGen, char format, String name, Date modificationTime, byte[] buffer) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides org. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |