C# Class Org.BouncyCastle.Bcpg.OpenPgp.PgpLiteralDataGenerator

Class for producing literal data packets.
Inheritance: IStreamGenerator
Exibir arquivo Open project: nonorganic/dssnet Class Usage Examples

Public Methods

Method Description
Close ( ) : void

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

Open ( Stream outStr, char format, FileInfo file ) : Stream

Open a literal data packet for the passed in FileInfo 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 Stream parameter outStr.

Open ( Stream outStr, char format, string name, System.DateTime modificationTime, byte buffer ) : Stream

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 Stream parameter outStr.

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 ( Stream outStr, char format, string name, long length, System.DateTime modificationTime ) : Stream

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 Stream parameter outStr.

PgpLiteralDataGenerator ( ) : System
PgpLiteralDataGenerator ( bool oldFormat ) : System

Generates literal data objects in the old format. This is important if you need compatibility with PGP 2.6.x.

Private Methods

Method Description
WriteHeader ( BcpgOutputStream outStr, char format, byte encName, long modificationTime ) : void

Method Details

Close() public method

Close the literal data packet - this is equivalent to calling Close() on the stream returned by the Open() method.
public Close ( ) : void
return void

Open() public method

Open a literal data packet for the passed in FileInfo 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 Stream parameter outStr.

public Open ( Stream outStr, char format, FileInfo file ) : Stream
outStr Stream The stream we want the packet in.
format char The format we are using.
file System.IO.FileInfo The FileInfo object containg the packet details.
return Stream

Open() public method

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 Stream parameter outStr.

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.

public Open ( Stream outStr, char format, string name, System.DateTime modificationTime, byte buffer ) : Stream
outStr Stream The stream we want the packet in.
format char The format we are using.
name string The name of the 'file'.
modificationTime System.DateTime The time of last modification we want stored.
buffer byte The buffer to use for collecting data to put into chunks.
return Stream

Open() public method

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 Stream parameter outStr.

public Open ( Stream outStr, char format, string name, long length, System.DateTime modificationTime ) : Stream
outStr Stream The stream we want the packet in.
format char The format we are using.
name string The name of the 'file'.
length long The length of the data we will write.
modificationTime System.DateTime The time of last modification we want stored.
return Stream

PgpLiteralDataGenerator() public method

public PgpLiteralDataGenerator ( ) : System
return System

PgpLiteralDataGenerator() public method

Generates literal data objects in the old format. This is important if you need compatibility with PGP 2.6.x.
public PgpLiteralDataGenerator ( bool oldFormat ) : System
oldFormat bool If true, uses old format.
return System