com.objsys.asn1j.runtime
Class Asn1XerBase64OctetString

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1Type
      extended by com.objsys.asn1j.runtime.Asn1OctetString
          extended by com.objsys.asn1j.runtime.Asn1XerBase64OctetString
All Implemented Interfaces:
Asn1TypeIF, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Asn1XerBase64OctetString
extends Asn1OctetString

This is a container class for holding the components of an ASN.1 octet string value. This is a special version of the class that is only generated for the XER encoding rules, if Base64 encoding is used.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1OctetString
TAG, value
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1Type
BIT_STRING, BMPString, BOOLEAN, ENUMERATED, EOC, EXTERNAL, GeneralString, GeneralTime, GraphicString, IA5String, INTEGER, NULL, NumericString, OBJECT_IDENTIFIER, ObjectDescriptor, OCTET_STRING, OpenType, PrintableString, REAL, RelativeOID, SEQUENCE, SET, T61String, TeletexString, UniversalString, UTCTime, UTF8String, VideotexString, VisibleString
 
Constructor Summary
Asn1XerBase64OctetString()
          This constructor creates an empty octet string that can be used in a decode method call to receive an octet string value.
Asn1XerBase64OctetString(byte[] data)
          This constructor initializes an octet string from the given byte array.
Asn1XerBase64OctetString(byte[] data, int offset, int nbytes)
          This constructor initializes an octet string from a portion of the given byte array.
Asn1XerBase64OctetString(java.lang.String value_)
          This constructor parses the given ASN.1 value text (either a binary or hex data string) and assigns the values to the internal bit string.
 
Method Summary
 void decodeXER(java.lang.String buffer, java.lang.String attrs)
          This method decodes ASN.1 octet string type using the XML encoding rules (XER).
 void decodeXML(java.lang.String buffer, java.lang.String attrs)
          This method decodes an ASN.1 octet string type using the XML schema encoding rules.
 void encode(Asn1XerEncoder buffer, java.lang.String elemName)
          This method encodes ASN.1 octet string type using the XML encoding rules (XER).
 void encode(Asn1XmlEncoder buffer, java.lang.String elemName, java.lang.String nsPrefix)
          This method encodes ASN.1 octet string type with element and attribute name tag according to the XML Encoding as specified in the XML schema standard(asn2xsd).
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1OctetString
compareTo, decode, decode, decode, encode, encode, encode, encode, encode, encode, encodeAttribute, equals, equals, getLength, toInputStream, toString
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1Type
clone, decode, decode, decode, encode, encode, encode, getTypeName, indent, isOpenType, matchTag, matchTag, pdiag, print, setKey, setOpenType
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Asn1XerBase64OctetString

public Asn1XerBase64OctetString()
This constructor creates an empty octet string that can be used in a decode method call to receive an octet string value.


Asn1XerBase64OctetString

public Asn1XerBase64OctetString(byte[] data)
This constructor initializes an octet string from the given byte array.

Parameters:
data - Byte array containing an octet string in binary form.

Asn1XerBase64OctetString

public Asn1XerBase64OctetString(byte[] data,
                                int offset,
                                int nbytes)
This constructor initializes an octet string from a portion of the given byte array. A new byte array is created starting at the given offset and consisting of the given number of bytes.

Parameters:
data - Byte array containing an octet string in binary form.
offset - Starting offset in data from which to copy bytes
nbytes - Number of bytes to copy from target array

Asn1XerBase64OctetString

public Asn1XerBase64OctetString(java.lang.String value_)
                         throws Asn1ValueParseException
This constructor parses the given ASN.1 value text (either a binary or hex data string) and assigns the values to the internal bit string. Examples of valid value formats are as follows: Binary string: '11010010111001'B Hex string: '0fa56920014abc'H Char string: 'abcdefg'

Parameters:
value_ - The ASN.1 value specification text
Throws:
Asn1ValueParseException
Method Detail

encode

public void encode(Asn1XerEncoder buffer,
                   java.lang.String elemName)
            throws java.io.IOException,
                   Asn1Exception
This method encodes ASN.1 octet string type using the XML encoding rules (XER).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OctetString
Parameters:
buffer - Encode message buffer object
elemName - XML element name used to wrap string
Throws:
java.io.IOException - Any exception thrown by the underlying stream.
Asn1Exception - Thrown, if operation is failed.

decodeXER

public void decodeXER(java.lang.String buffer,
                      java.lang.String attrs)
               throws Asn1Exception
This method decodes ASN.1 octet string type using the XML encoding rules (XER).

Overrides:
decodeXER in class Asn1OctetString
Parameters:
buffer - String containing data to be decoded
attrs - Attributes string from element tag
Throws:
Asn1Exception

encode

public void encode(Asn1XmlEncoder buffer,
                   java.lang.String elemName,
                   java.lang.String nsPrefix)
            throws java.io.IOException,
                   Asn1Exception
This method encodes ASN.1 octet string type with element and attribute name tag according to the XML Encoding as specified in the XML schema standard(asn2xsd).

Specified by:
encode in interface Asn1TypeIF
Overrides:
encode in class Asn1OctetString
Parameters:
buffer - Encode message buffer object
elemName - XML element name used to wrap string
nsPrefix - Element namespace prefix value
Throws:
java.io.IOException - Any exception thrown by the underlying stream.
Asn1Exception - Thrown, if operation is failed.

decodeXML

public void decodeXML(java.lang.String buffer,
                      java.lang.String attrs)
               throws Asn1Exception
This method decodes an ASN.1 octet string type using the XML schema encoding rules.

Specified by:
decodeXML in interface Asn1TypeIF
Overrides:
decodeXML in class Asn1OctetString
Parameters:
buffer - String containing data to be decoded
attrs - Attributes string from element tag
Throws:
Asn1Exception