List of usage examples for org.bouncycastle.bcpg BCPGInputStream readPacket
public Packet readPacket() throws IOException
From source file:org.sufficientlysecure.keychain.pgp.WrappedUserAttribute.java
License:Open Source License
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { byte[] data = (byte[]) in.readObject(); BCPGInputStream bcpg = new BCPGInputStream(new ByteArrayInputStream(data)); Packet p = bcpg.readPacket(); if (!UserAttributePacket.class.isInstance(p)) { throw new IOException("Could not decode UserAttributePacket!"); }//w ww . j a v a 2 s. c o m mVector = new PGPUserAttributeSubpacketVector(((UserAttributePacket) p).getSubpackets()); }