|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.asnlab.asndt.runtime.type.AsnType
public abstract class AsnType
Instances of the class AsnType
represent the metadata
of ASN.1 type. The metadata type is independent of any concrete value
which may be represent by anything. Value object is related to metadata
type by means of AsnConverter
.
The following example uses a AsnType
object
and a AsnConverter
to encode a value object:
object = ... type = ... converter = ... type.encode(object, buffer, converter);
Field Summary | |
---|---|
static boolean |
DEBUG
|
static java.lang.String |
VERSION
|
Fields inherited from interface org.asnlab.asndt.runtime.conv.EncodingRules |
---|
ALIGNED_PACKED_ENCODING_RULES, BASIC_ENCODING_RULES, CANONICAL_ENCODING_RULES, DISTINGUISHED_ENCODING_RULES, UNALIGNED_PACKED_ENCODING_RULES |
Constructor Summary | |
---|---|
AsnType()
|
Method Summary | |
---|---|
java.lang.Object |
clone(java.lang.Object object,
AsnConverter converter)
Clone a copy of the object |
static AsnConverter |
createAsnTypeConverter()
|
static AsnType |
createAsnTypeType()
|
java.lang.Object |
decode(Buffer buffer,
AsnConverter converter)
Decode object from buffer. |
java.lang.Object |
decode(byte[] content,
AsnConverter converter)
Decode object from byte array using UNALIGNED_PACKED_ENCODING_RULES |
java.lang.Object |
decode(byte[] content,
byte encodingRules,
AsnConverter converter)
Decode object from byte array |
java.lang.Object |
decode(java.io.InputStream in,
byte encodingRules,
AsnConverter converter)
Decode the object from input stream |
protected byte[] |
decodeRawdata(org.asnlab.asndt.runtime.type.BitBuffer buffer)
|
byte[] |
encode(java.lang.Object object,
AsnConverter converter)
Encode object into byte array using UNALIGNED_PACKED_ENCODING_RULES |
void |
encode(java.lang.Object object,
Buffer buffer,
AsnConverter converter)
Encode the object into buffer. |
byte[] |
encode(java.lang.Object object,
byte encodingRules,
AsnConverter converter)
Encode object into byte array |
void |
encode(java.lang.Object object,
byte encodingRules,
AsnConverter converter,
java.io.OutputStream out)
Encode the object into output stream |
protected void |
encodeRawdata(org.asnlab.asndt.runtime.type.BitBuffer buffer,
byte[] rawdata)
|
static int |
encodeTag(short tagClass,
short tagForm,
int tagNumber)
Encode the tag |
boolean |
equals(java.lang.Object o1,
java.lang.Object o2,
AsnConverter converter)
Tells whether the two objects o1 , o2 is equal
from the point of view of ASN.1. |
boolean |
equals(java.lang.Object o1,
java.lang.Object o2,
AsnConverter c1,
AsnConverter c2)
Tells whether the two objects o1 , o2 is equal
from the point of view of ASN.1. |
abstract AsnConverter |
getGenericConverter()
Return the "generic" AsnConverter for this metadata type |
abstract int |
getTypeId()
Return the id of this type |
protected static byte[] |
int2bytes(int number)
|
protected static byte[] |
long2bytes(long number)
|
protected static int |
numOfBits(int n)
|
protected static int |
numOfBits(long n)
|
protected static int |
numOfBytes(int number)
|
protected static int |
numOfBytes(long number)
|
protected static int |
numOfBytes(short number)
|
protected static int |
numOfOcts(int n)
|
protected static int |
numOfOcts(long n)
|
java.io.PrintStream |
print(java.lang.Object object,
AsnConverter converter,
java.io.PrintStream out)
Print out the readable message of this object. |
protected static byte[] |
short2bytes(short number)
|
protected void |
skipTLV(org.asnlab.asndt.runtime.type.ByteBuffer buffer,
int tag)
|
static java.lang.String |
toHexString(byte[] octets)
|
protected static byte[] |
unsignedint2bytes(int number)
|
protected static byte[] |
unsignedlong2bytes(long number)
|
protected static byte[] |
unsignint2seplets(int value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static boolean DEBUG
Constructor Detail |
---|
public AsnType()
Method Detail |
---|
public abstract int getTypeId()
public byte[] encode(java.lang.Object object, AsnConverter converter)
UNALIGNED_PACKED_ENCODING_RULES
object
- The object to encodeconverter
- The ASN.1 metadata converterpublic java.lang.Object decode(byte[] content, AsnConverter converter)
UNALIGNED_PACKED_ENCODING_RULES
content
- The encoding content to decodeconverter
- The ASN.1 metadata converterpublic byte[] encode(java.lang.Object object, byte encodingRules, AsnConverter converter)
object
- The object to encodeencodingRules
- The encoding rulesconverter
- The ASN.1 metadata converterpublic java.lang.Object decode(byte[] content, byte encodingRules, AsnConverter converter)
content
- The encoding content to decodeencodingRules
- The encoding rulesconverter
- The ASN.1 metadata converterpublic void encode(java.lang.Object object, byte encodingRules, AsnConverter converter, java.io.OutputStream out) throws java.io.IOException
object
- The object to encodeencodingRules
- The encoding rulesconverter
- The converter specific to the objectout
- The output stream to encode into
java.io.IOException
- If error in writing to output streampublic java.lang.Object decode(java.io.InputStream in, byte encodingRules, AsnConverter converter) throws java.io.IOException
in
- The input stream to decode fromencodingRules
- The encoding rulesconverter
- The converter specific to the object
java.io.IOException
- If error in reading from input streampublic void encode(java.lang.Object object, Buffer buffer, AsnConverter converter)
object
- The object to encodebuffer
- The working bufferconverter
- The converter specific to the objectpublic java.lang.Object decode(Buffer buffer, AsnConverter converter)
buffer
- The working bufferconverter
- The object specific converter
protected void skipTLV(org.asnlab.asndt.runtime.type.ByteBuffer buffer, int tag)
protected void encodeRawdata(org.asnlab.asndt.runtime.type.BitBuffer buffer, byte[] rawdata)
protected byte[] decodeRawdata(org.asnlab.asndt.runtime.type.BitBuffer buffer)
public abstract AsnConverter getGenericConverter()
public java.lang.Object clone(java.lang.Object object, AsnConverter converter)
object
- The object to cloneconverter
- The object specific converter
public boolean equals(java.lang.Object o1, java.lang.Object o2, AsnConverter converter)
o1
, o2
is equal
from the point of view of ASN.1.
o1
- The 1st objecto2
- The 2nd objectconverter
- The metadata converter
public boolean equals(java.lang.Object o1, java.lang.Object o2, AsnConverter c1, AsnConverter c2)
o1
, o2
is equal
from the point of view of ASN.1.
o1
- The 1st objecto2
- The 2nd objectc1
- The 1st converterc2
- The 2nd converter
public java.io.PrintStream print(java.lang.Object object, AsnConverter converter, java.io.PrintStream out)
object
- The object to encodeconverter
- The converter specific to the objectout
- The output print streampublic static int encodeTag(short tagClass, short tagForm, int tagNumber)
public static AsnType createAsnTypeType()
public static AsnConverter createAsnTypeConverter()
protected static byte[] short2bytes(short number)
protected static byte[] int2bytes(int number)
protected static byte[] unsignedint2bytes(int number)
protected static byte[] long2bytes(long number)
protected static byte[] unsignedlong2bytes(long number)
protected static byte[] unsignint2seplets(int value)
protected static int numOfBytes(short number)
protected static int numOfBytes(int number)
protected static int numOfBytes(long number)
protected static int numOfOcts(int n)
protected static int numOfOcts(long n)
protected static int numOfBits(int n)
protected static int numOfBits(long n)
public static java.lang.String toHexString(byte[] octets)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |