Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BCPGObject.java « bcpg « spongycastle « org « java « main « src « pg - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 10d87498386445c97033c2ed428ee4283fc178af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.spongycastle.bcpg;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

/**
 * Base class for a PGP object.
 */
public abstract class BCPGObject
{
    public byte[] getEncoded()
        throws IOException
    {
        ByteArrayOutputStream    bOut = new ByteArrayOutputStream();
        BCPGOutputStream         pOut = new BCPGOutputStream(bOut);

        pOut.writeObject(this);

        return bOut.toByteArray();
    }

    public abstract void encode(BCPGOutputStream out)
        throws IOException;
}