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.
static char | BINARY
|
static String | CONSOLE - The special name indicating a "for your eyes only" packet.
|
static Date | NOW - The special time for a modification time of "now" or
the present time.
|
static char | TEXT
|
void | close() - Close the literal data packet.
|
OutputStream | open(OutputStream out, char format, File file) - Open a literal data packet for the passed in File object, returning
an output stream for saving the file contents.
|
OutputStream | open(OutputStream out, char format, String name, Date modificationTime, byte[] buffer) - Open a literal data packet, returning a stream to store the data inside
the packet as an indefiinite length stream.
|
OutputStream | open(OutputStream out, char format, String name, long length, Date modificationTime) - Open a literal data packet, returning a stream to store the data inside
the packet.
|
BINARY
public static final char BINARY
CONSOLE
public static final String CONSOLE
The special name indicating a "for your eyes only" packet.
NOW
public static final Date NOW
The special time for a modification time of "now" or
the present time.
TEXT
public static final char TEXT
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.
oldFormat
-
close
public void close()
throws IOException
Close the literal data packet.
open
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.
out
- format
- file
-
- OutputStream
open
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 indefiinite 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.
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.
out
- the stream we want the packet informat
- the format we are usingname
- 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.
open
public OutputStream open(OutputStream out,
char format,
String name,
long length,
Date modificationTime)
throws IOException
Open a literal data packet, returning a stream to store the data inside
the packet.
out
- the stream we want the packet informat
- the format we are usingname
- the name of the "file"length
- the length of the data we will writemodificationTime
- the time of last modification we want stored.