Package com.oss.asn1

Class HugeContainingBitString<T extends AbstractData>

Type Parameters:
T - type of contained value
All Implemented Interfaces:
com.oss.asn1.PDUContainer<T>, com.oss.asn1.Sizeable, Serializable, Cloneable

public class HugeContainingBitString<T extends AbstractData> extends HugeBitString implements com.oss.asn1.Sizeable, com.oss.asn1.PDUContainer<T>
The HugeContainingBitString class represents a BIT STRING constrained by a ContentsConstraint, with the ValueInFile directive applied. The runtime presents the value of this type in two forms: interpreted (the unencoded contained value) or uninterpreted (raw bits).
For this reason, the class could behave differently when compared with the HugeBitString class:
  1. When the automatic decoding of contained values is enabled and the content constraint allows automatic decoding, the coder constructs the decoded value using the interpreted form. Hence, getDecodedValue() returns the contained value, while byteStorageValue() returns null, and getSize() returns zero. Otherwise, the value is constructed using the uninterpreted form, where byteStorageValue() and getSize() return raw bits, and getDecodedValue() returns null.
  2. When the automatic encoding of contained values is enabled, the content constraint allows automatic encoding, and the input value is specified in the interpreted form, the coder automatically constructs the bits of the BIT STRING from the contained value and writes them to the output encoding. Otherwise, the coder requires that the uninterpreted form is available before encoding, and throws an exception if it is not.
Since:
ASN.1/Java 1.5
See Also:
  • Constructor Details

    • HugeContainingBitString

      public HugeContainingBitString()
      The default constructor creates an empty bit string
    • HugeContainingBitString

      public HugeContainingBitString(ByteStorage value)
      Construct from a ByteStorage object. The significant bits are set to the number of octets in the ByteStorage multiplied by 8.
      Parameters:
      value - the ByteStorage to set this object to.
    • HugeContainingBitString

      public HugeContainingBitString(ByteStorage value, int sigBits)
      Construct from a ByteStorage object with the specified number of significant bits.
      Parameters:
      value - the ByteStorage to set this object to.
      sigBits - the number of significant bits.
    • HugeContainingBitString

      public HugeContainingBitString(T decodedValue)
      Construct an instance of this class with an AbstractData object that represents an unencoded value of a contained ASN.1 type.
      Parameters:
      decodedValue - the AbstractData object to set.
  • Method Details

    • getDecodedValue

      public final T getDecodedValue()
      Get the unencoded value of contained ASN.1 type. This will be useful when automatic decoding has been used. See the method enableAutomaticDecoding() in the Coder class.
      Specified by:
      getDecodedValue in interface com.oss.asn1.PDUContainer<T extends AbstractData>
      Returns:
      reference to the AbstractData object representing the unencoded value of 'this' object.
    • setDecodedValue

      public final void setDecodedValue(T decodedValue)
      Set the value to the interpreted form (the value of the contained ASN.1 type). After this method is invoked the byteStorageValue() method will return null and the getSize() method will return zero.
      Specified by:
      setDecodedValue in interface com.oss.asn1.PDUContainer<T extends AbstractData>
      Parameters:
      decodedValue - the reference to the AbstractData object to set.
    • getContainedValue

      public T getContainedValue()
      Get the unencoded value of contained ASN.1 type. This will be useful when automatic decoding has been used. See the method enableAutomaticDecoding() in the Coder class.
      Returns:
      reference to the AbstractData object representing the unencoded value of 'this' object.
    • setContainedValue

      public void setContainedValue(T decodedValue)
      Set the value to the interpreted form (the value of the contained ASN.1 type). After this method is invoked the byteStorageValue() method will return null and the getSize() method will return zero.
      Parameters:
      decodedValue - the reference to the AbstractData object to set.
    • equalTo

      public final boolean equalTo(HugeContainingBitString that)
      Compare 'this' object to another HugeContainingBitString object to see if their contents are the same. If the ASN.1 definition of the BIT STRING has named bits then the comparison ignores trailing zero bits in the BIT STRING value.
      Parameters:
      that - the HugeContainingBitString object to compare 'this' object to.
      Returns:
      true if contents of both objects are the same.
    • clone

      public Object clone()
      Clone 'this' object.
      Overrides:
      clone in class HugeBitString
      Returns:
      deep copy of 'this' object.
    • getSize

      int getSize()
      Get the number of elements in the array of objects.
      Returns:
      number of elements in the array.