Package com.oss.asn1

Class OpenType

All Implemented Interfaces:
com.oss.asn1.PDUContainer, Serializable, Cloneable

public class OpenType extends AbstractOpenType
The OpenType class represents the ASN.1 ANY and the open type. This class is used to carry any valid ASN.1 type as an open type.
Since:
ASN.1/Java 6.0
See Also:
  • Constructor Details

    • OpenType

      public OpenType()
      The default constructor.
    • OpenType

      Construct an instance of this class with a PDU object reference that represents the un-encoded value of a valid ASN.1 type. The "coder" will be used to encode the 'pdu' into a byte array.
      Parameters:
      pdu - an AbstractData object representing a PDU.
      coder - a Coder object used to encode "pdu".
      Throws:
      EncodeNotSupportedException - when encoding disabled.
      EncodeFailedException - when "pdu" cannot be encoded.
    • OpenType

      public OpenType(byte[] encodedValue)
      Construct an instance of this class with a byte array that represents the encoding of a valid ASN.1 type.
      Parameters:
      encodedValue - the byte array of encoded data to set.
    • OpenType

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

    • getEncodedValue

      public final byte[] getEncodedValue()
      Get the encoding of an instance of a valid ASN.1 type. This will be useful when manual decoding has been used. Manual decoding is used by default or when disableAutomaticDecoding() is invoked.
      Returns:
      byte array representing the encoded data.
    • getEncodedValueAsStream

      public final InputStream getEncodedValueAsStream()
      Get the encoding of an instance of a valid ASN.1 type. This will be useful when manual decoding has been used. The stream returned can be passed as the first parameter to the decode method of the Coder. Manual decoding is used by default or when disableAutomaticDecoding() is invoked.
      Specified by:
      getEncodedValueAsStream in class AbstractOpenType
      Returns:
      InputStream representing the encoded data.
    • setEncodedValue

      public void setEncodedValue(byte[] encodedValue)
      Set the encoded data, an encoding of a valid ASN.1 type.
      Parameters:
      encodedValue - the byte array of encoded data to set.
    • setDecodedValue

      public void setDecodedValue(AbstractData decodedValue)
      Set the unencoded data of a valid ASN.1 type.
      Specified by:
      setDecodedValue in interface com.oss.asn1.PDUContainer
      Overrides:
      setDecodedValue in class AbstractOpenType
      Parameters:
      decodedValue - the reference to the AbstractData object to set.
    • equalTo

      public final boolean equalTo(OpenType that)
      Compare 'this' object to another OpenType object to see if their contents are the same.
      Parameters:
      that - the OpenType object to compare 'this' object to.
      Returns:
      true if contents of both objects are the same.
    • clone

      public OpenType clone()
      Clone 'this' object.
      Returns:
      deep copy of 'this' object.
    • delete

      public void delete()
      Destroy the instance of the AbstractData. The contract of this method is to facilitate garbage collection by explicit destruction of the data that is no longer needed.
      Overrides:
      delete in class AbstractOpenType
    • hashCode

      public int hashCode()
      Returns a hash code for this object
      Overrides:
      hashCode in class AbstractData
      Returns:
      a hash code for this object
    • getTypeName

      public String getTypeName()
      Returns the name of ASN.1 type this java class represents.
      Overrides:
      getTypeName in class AbstractData
      Returns:
      the name of the ASN.1 type.