package org.bouncycastle.asn1;
import java.io.IOException;
public abstract class ASN1Object
extends DERObject
{
public static ASN1Object fromByteArray(byte[] data)
throws IOException
{
ASN1InputStream aIn = new ASN1InputStream(data);
try
{
return (ASN1Object)aIn.readObject();
}
catch (ClassCastException e)
{
throw new IOException("cannot recognise object in stream");
}
}
public final boolean equals(Object o)
{
if (this == o)
{
return true;
}
return (o instanceof DEREncodable) && asn1Equals(((DEREncodable)o).getDERObject());
}
public abstract int hashCode();
abstract void encode(DEROutputStream out) throws IOException;
abstract boolean asn1Equals(DERObject o);
}