01: package org.bouncycastle.bcpg;
02:
03: import java.io.ByteArrayOutputStream;
04: import java.io.IOException;
05:
06: /**
07: * base class for a PGP object.
08: */
09: public abstract class BCPGObject {
10: public byte[] getEncoded() throws IOException {
11: ByteArrayOutputStream bOut = new ByteArrayOutputStream();
12: BCPGOutputStream pOut = new BCPGOutputStream(bOut);
13:
14: pOut.writeObject(this );
15:
16: return bOut.toByteArray();
17: }
18:
19: public abstract void encode(BCPGOutputStream out)
20: throws IOException;
21: }
|