Methods Summary |
---|
public java.lang.Object | decode(BerInputStream in)
in.readInteger();
if (in.isVerify) {
return null;
}
return getDecodedObject(in);
|
public void | encodeContent(BerOutputStream out)
out.encodeInteger();
|
public static java.lang.Object | fromIntValue(int value)Converts primitive int value to a form most suitable for encoding.
//FIXME optimize
return BigInteger.valueOf(value).toByteArray();
|
public java.lang.Object | getDecodedObject(BerInputStream in)Extracts array of bytes from BER input stream.
byte[] bytesEncoded = new byte[in.length];
System.arraycopy(in.buffer, in.contentOffset, bytesEncoded, 0,
in.length);
return bytesEncoded;
|
public static org.apache.harmony.security.asn1.ASN1Integer | getInstance()Returns ASN.1 Integer type default implementation
The default implementation works with encoding
that is represented as byte array in two's-complement notation.
return ASN1;
|
public void | setEncodingContent(BerOutputStream out)
out.length = ((byte[]) out.content).length;
|
public static java.math.BigInteger | toBigIntegerValue(java.lang.Object decoded)Converts decoded ASN.1 Integer to a BigInteger.
return new BigInteger((byte[]) decoded);//FIXME optimize
|
public static int | toIntValue(java.lang.Object decoded)Converts decoded ASN.1 Integer to int value.
If the object represents an integer value
larger than 32 bits, the high bits will be lost.
return new BigInteger((byte[]) decoded).intValue();//FIXME optimize
|