public class BCPGOutputStream extends OutputStream implements PacketTags, CompressionAlgorithmTags
COMPRESSED_DATA, EXPERIMENTAL_1, EXPERIMENTAL_2, EXPERIMENTAL_3, EXPERIMENTAL_4, LITERAL_DATA, MARKER, MOD_DETECTION_CODE, ONE_PASS_SIGNATURE, PUBLIC_KEY, PUBLIC_KEY_ENC_SESSION, PUBLIC_SUBKEY, RESERVED, SECRET_KEY, SECRET_SUBKEY, SIGNATURE, SYM_ENC_INTEGRITY_PRO, SYMMETRIC_KEY_ENC, SYMMETRIC_KEY_ENC_SESSION, TRUST, USER_ATTRIBUTE, USER_ID
BZIP2, UNCOMPRESSED, ZIP, ZLIB
Constructor and Description |
---|
BCPGOutputStream(OutputStream out) |
BCPGOutputStream(OutputStream out,
int tag)
Create a stream representing an old style partial object.
|
BCPGOutputStream(OutputStream out,
int tag,
byte[] buffer)
Create a new style partial input stream buffered into chunks.
|
BCPGOutputStream(OutputStream out,
int tag,
long length) |
BCPGOutputStream(OutputStream out,
int tag,
long length,
boolean oldFormat)
Create a stream representing a general packet.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finish()
Finish writing out the current packet without closing the underlying stream.
|
void |
flush()
Flush the underlying stream.
|
void |
write(byte[] bytes,
int off,
int len) |
void |
write(int b) |
void |
writeObject(BCPGObject o) |
void |
writePacket(ContainedPacket p) |
write
public BCPGOutputStream(OutputStream out)
public BCPGOutputStream(OutputStream out, int tag) throws IOException
tag
- the packet tag for the object.IOException
public BCPGOutputStream(OutputStream out, int tag, long length, boolean oldFormat) throws IOException
out
- tag
- length
- oldFormat
- IOException
public BCPGOutputStream(OutputStream out, int tag, long length) throws IOException
tag
- length
- IOException
public BCPGOutputStream(OutputStream out, int tag, byte[] buffer) throws IOException
out
- output stream to write to.tag
- packet tag.buffer
- size of chunks making up the packet.IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] bytes, int off, int len) throws IOException
write
in class OutputStream
IOException
public void writePacket(ContainedPacket p) throws IOException
IOException
public void writeObject(BCPGObject o) throws IOException
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void finish() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException