asn1encodable.java
来自「这是一个基于java编写的torrent的P2P源码」· Java 代码 · 共 45 行
JAVA
45 行
package org.bouncycastle.asn1;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public abstract class ASN1Encodable
implements DEREncodable
{
public byte[] getEncoded()
throws IOException
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
aOut.writeObject(this);
return bOut.toByteArray();
}
public int hashCode()
{
return this.getDERObject().hashCode();
}
public boolean equals(
Object o)
{
if ((o == null) || !(o instanceof DEREncodable))
{
return false;
}
DEREncodable other = (DEREncodable)o;
return this.getDERObject().equals(other.getDERObject());
}
public DERObject getDERObject()
{
return this.toASN1Object();
}
public abstract DERObject toASN1Object();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?