Code example for ObjectInputStream

Methods: readBoolean, readObject

0
 
    private void readObject( 
        ObjectInputStream in)
        throws IOException, ClassNotFoundException 
    { 
        byte[] enc = (byte[])in.readObject();
 
        populateFromPrivKeyInfo(PrivateKeyInfo.getInstance(ASN1Primitive.fromByteArray(enc)));
 
        this.algorithm = (String)in.readObject();
        this.withCompression = in.readBoolean();
        this.attrCarrier = new PKCS12BagAttributeCarrierImpl();
 
        attrCarrier.readObject(in);
    } 
 
    private void writeObject( 
        ObjectOutputStream out)
        throws IOException 
    { 
        out.writeObject(this.getEncoded());