org.bouncycastle.bcpg

Class BCPGOutputStream

public class BCPGOutputStream extends OutputStream implements PacketTags, CompressionAlgorithmTags

Basic output stream.
Constructor Summary
BCPGOutputStream(OutputStream out)
BCPGOutputStream(OutputStream out, int tag)
Create a stream representing an old style partial object.
BCPGOutputStream(OutputStream out, int tag, long length, boolean oldFormat)
Create a stream representing a general packet.
BCPGOutputStream(OutputStream out, int tag, long length)
BCPGOutputStream(OutputStream out, int tag, byte[] buffer)
Create a new style partial input stream buffered into chunks.
Method Summary
voidclose()
voidfinish()
Finish writing out the current packet without closing the underlying stream.
voidflush()
Flush the underlying stream.
voidwrite(int b)
voidwrite(byte[] bytes, int off, int len)
voidwriteObject(BCPGObject o)
voidwritePacket(ContainedPacket p)

Constructor Detail

BCPGOutputStream

public BCPGOutputStream(OutputStream out)

BCPGOutputStream

public BCPGOutputStream(OutputStream out, int tag)
Create a stream representing an old style partial object.

Parameters: tag the packet tag for the object.

BCPGOutputStream

public BCPGOutputStream(OutputStream out, int tag, long length, boolean oldFormat)
Create a stream representing a general packet.

Parameters: out tag length oldFormat

Throws: IOException

BCPGOutputStream

public BCPGOutputStream(OutputStream out, int tag, long length)

Parameters: tag length

Throws: IOException

BCPGOutputStream

public BCPGOutputStream(OutputStream out, int tag, byte[] buffer)
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 Detail

close

public void close()

finish

public void finish()
Finish writing out the current packet without closing the underlying stream.

flush

public void flush()
Flush the underlying stream.

write

public void write(int b)

write

public void write(byte[] bytes, int off, int len)

writeObject

public void writeObject(BCPGObject o)

writePacket

public void writePacket(ContainedPacket p)