📄 derenumerated.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: DEREnumerated.java
package jit.asn1;
import java.io.IOException;
import jit.math.BigInteger;
// Referenced classes of package jit.asn1:
// DERObject, ASN1OctetString, ASN1TaggedObject, DEROutputStream
public class DEREnumerated extends DERObject
{
byte bytes[];
public static DEREnumerated getInstance(Object obj)
{
if(obj == null || (obj instanceof DEREnumerated))
return (DEREnumerated)obj;
if(obj instanceof ASN1OctetString)
return new DEREnumerated(((ASN1OctetString)obj).getOctets());
if(obj instanceof ASN1TaggedObject)
return getInstance(((ASN1TaggedObject)obj).getObject());
else
throw new IllegalArgumentException("illegal object in getInstance: ".concat(String.valueOf(String.valueOf(obj.getClass().getName()))));
}
public static DEREnumerated getInstance(ASN1TaggedObject obj, boolean explicit)
{
return getInstance(obj.getObject());
}
public DEREnumerated(int value)
{
bytes = BigInteger.valueOf(value).toByteArray();
}
public DEREnumerated(BigInteger value)
{
bytes = value.toByteArray();
}
public DEREnumerated(byte bytes[])
{
this.bytes = bytes;
}
public BigInteger getValue()
{
return new BigInteger(bytes);
}
void encode(DEROutputStream out)
throws IOException
{
out.writeEncoded(10, bytes);
}
public boolean equals(Object o)
{
if(o == null || !(o instanceof DEREnumerated))
return false;
DEREnumerated other = (DEREnumerated)o;
if(bytes.length != other.bytes.length)
return false;
for(int i = 0; i != bytes.length; i++)
if(bytes[i] != other.bytes[i])
return false;
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -