All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----oclc.ber.ASN1
The BER utilities presented here are a translation of the C version of berutil written by Ralph Levan at OCLC. The documentation presented here is pretty much taken from his docummentation.
OCLC has chosen not to use an ASN.1 compiler in its ASN.1 activities. These activities include ASN.1 encoding of z39.50, DBI (an internal variant on z39.50) and ASN.1 encoding of all database records, including MARC records. Strictly speaking, OCLC does not use ASN.1 internally, other than as a language for communicating record specifications to programmers. However, all the records mentioned above are encoded using the Basic Encoding Rules and are manipulable by the BER decoders of ASN.1 compilers. We have chosen to represent the BER records internally as a tree structure of linked lists that describe the parts of the BER record. We believe that this hierarchical structure fully represents the complexity of record encodable with the BER. The nodes in this tree structure contain the BER tag, class, form and either a pointer to data or a pointer to the next node down in the hierarchy, depending on whether the form was primitive or constructed. We often use a picture of this tree structure for describing the syntax of the record being encoded, rather than using ASN.1. For instance, the DeleteResultSetRequest is described in ASN.1 as:
DeleteResultSetRequest ::= SEQUENCE {referenceId ReferenceId OPTIONAL, deleteSetFunction [32] IMPLICIT INTEGER {DeleteSpecificSet (0), deleteAllSets (1)} resultSetId ResultSetId OPTIONAL}with appropriate definitions for the non-terminals given somewhere else. We describe the same thing with the following picture:
DeleteResultSetRequest [26] | [ReferenceId [2]] --- deleteSetFunction [32] --- [resultSetId [31]] | OCTETSTRINGwith appropriate descriptions of the values that the leaves in the tree can take. We do not make any claims that this is better than ASN.1, it's just that it maps directly into the tree structure that gets mapped into and out of the BER records. What we lose by using our own internal syntax is the use of a Presentation Layer produced by someone else. This means that currently those things that could be done by the Presentation layer are done by the application. This includes integer byte ordering, characterset translation and BER encoding. While this could be a major loss, is hasn't been one so far and we haven't heard of any real Presentation layers that do all the things promised anyway.
public final static byte UNIVERSAL
public final static byte APPLICATION
public final static byte CONTEXT
public final static byte PRIVATE
public final static byte PRIMITIVE
public final static byte CONSTRUCTED
public final static byte BOOLEAN
public final static byte INTEGER
public final static byte BITSTRING
public final static byte OCTETSTRING
public final static byte NULL
public final static byte OBJECTIDENTIFIER
public final static byte OBJECTDESCRIPTOR
public final static byte EXTERNAL
public final static byte SEQUENCE
public final static byte SET
public final static byte VISIBLESTRING
public final static byte GENERALSTRING
public final static byte single_ASN1_type
public final static byte octet_aligned
public final static byte arbitrary
public ASN1()
protected final static int tagLen(int fldid)
protected final static int lenLen(int length)
protected final static int numLen(int num)
protected final static void putNum(byte record[], int offset, int num)
public final static int getNum(byte record[], int offset, int len)
All Packages Class Hierarchy This Package Previous Next Index