Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.45
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.bouncycastle.openpgp
Class PGPLiteralDataGenerator

    java.lang.Object
      org.bouncycastle.openpgp.PGPLiteralDataGenerator

    public class PGPLiteralDataGenerator

extends java.lang.Object

Class for producing literal data packets.

Field Summary
`static char` | `BINARY`
`static java.lang.String` | `CONSOLE` The special name indicating a "for your eyes only" packet.
`static java.util.Date` | `NOW` The special time for a modification time of "now" or the present time.
`static char` | `TEXT`

Constructor Summary
`PGPLiteralDataGenerator()`
`PGPLiteralDataGenerator(boolean oldFormat)` Generates literal data objects in the old format, this is important if you need compatability with PGP 2.6.x.

Method Summary
`void` | `close()` Close the literal data packet - this is equivalent to calling close on the stream returned by the open() method.
`java.io.OutputStream` | `open(java.io.OutputStream out, char format, java.io.File file)` Open a literal data packet for the passed in File object, returning an output stream for saving the file contents.
`java.io.OutputStream` | `open(java.io.OutputStream out, char format, java.lang.String name, java.util.Date modificationTime, byte[] buffer)` Open a literal data packet, returning a stream to store the data inside the packet as an indefinite length stream.
`java.io.OutputStream` | `open(java.io.OutputStream out, char format, java.lang.String name, long length, java.util.Date modificationTime)` Open a literal data packet, returning a stream to store the data inside the packet.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BINARY

    public static final char BINARY

See Also:
  Constant Field Values

### TEXT

    public static final char TEXT

See Also:
  Constant Field Values

### CONSOLE

    public static final java.lang.String CONSOLE

  The special name indicating a "for your eyes only" packet.

  See Also:
    Constant Field Values

### NOW

    public static final java.util.Date NOW

  The special time for a modification time of "now" or the present time.

Constructor Detail

### PGPLiteralDataGenerator

    public PGPLiteralDataGenerator()

### PGPLiteralDataGenerator

    public PGPLiteralDataGenerator(boolean oldFormat)

  Generates literal data objects in the old format, this is important if you need compatability with PGP 2.6.x.

  Parameters:
    `oldFormat` -

Method Detail

### open

    public java.io.OutputStream open(java.io.OutputStream out,
                                     char format,
                                     java.lang.String name,
                                     long length,
                                     java.util.Date modificationTime)
                              throws java.io.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.

  Parameters:
    `out` - the stream we want the packet in
    `format` - the format we are using
    `name` - the name of the "file"
    `length` - the length of the data we will write
    `modificationTime` - the time of last modification we want stored.
  Throws:
    `java.io.IOException`

### open

    public java.io.OutputStream open(java.io.OutputStream out,
                                     char format,
                                     java.lang.String name,
                                     java.util.Date modificationTime,
                                     byte[] buffer)
                              throws java.io.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.

  Parameters:
    `out` - the stream we want the packet in
    `format` - the format we are using
    `name` - the name of the "file"
    `modificationTime` - the time of last modification we want stored.
    `buffer` - the buffer to use for collecting data to put into chunks.
  Throws:
    `java.io.IOException`

### open

    public java.io.OutputStream open(java.io.OutputStream out,
                                     char format,
                                     java.io.File file)
                              throws java.io.IOException

  Open a literal data packet for the passed in File object, returning an output stream for saving the file contents.

  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.

  Parameters:
    `out` -
    `format` -
    `file` -
  Returns:
    OutputStream
  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Close the literal data packet - this is equivalent to calling close on the stream returned by the open() method.

  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.45
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD