TOC PREV NEXT INDEX


BIT STRING



The ASN.1 BIT STRING type is converted to a Java class that extends the Asn1BitString run-time class. This base class encapsulates the following two public member variables:

    public int numbits;
 
    public byte[] value;
 

These describe the bit string to be encoded or decoded.

The following shows the basic mapping from ASN.1 type to Java class definition:

ASN.1 Production:
<name> ::= BIT STRING


 
Generated Java class:

public class <name> extends Asn1BitString {
 
   public <name> () {
 
      super();
 
   }
 
   public <name> (int numbits_, byte[] data) {
 
      super (numbits_, data);
 
   }
 
   public <name> (boolean[] bitValues) {
 
      super (bitValues);
 
   }
 
   public <name> (String value_) 
 
   throws Asn1ValueParseException {
 
      super (value_);
 
   }
 
}


 



This shows the class generated for a simple BIT STRING assignment. If a tagged or constrained type is specified, specific encode and decode methods will be generated as well.

The constructors generated for this type provide additional options for populating the member variables in the base class. In addition to passing the string using the numbits and data arguments to specify a bit string in native format, the string can be specified as an array of boolean values or as a string. The string form expects the string to be passed in the ASN.1 value notation format for either a binary string (i.e., `xxxx'B) or a hexadecimal string (i.e., `xxxx'H).


Objective Systems, Inc.

102 Pickering Way, Suite #506
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX

Copyright © 1997-2004 Objective Systems,Inc.
All Rights Reserved.


This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.