org.demac.impl.j2me.process.base.service.webservices.asn1
Class ASN1UTF8String

java.lang.Object
  extended by org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractType
      extended by org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractString
          extended by org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1UTF8String
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, ASN1String, ASN1Type

public class ASN1UTF8String
extends ASN1AbstractString

This class represents an ASN.1 UTF 8 String as described in ITU-T Recommendation X.680.

See Also:
Serialized Form

Constructor Summary
ASN1UTF8String()
          Creates an instance.
ASN1UTF8String(java.lang.String s)
          Creates an instance with the given string value.
 
Method Summary
 java.lang.String convert(byte[] b)
          Converts the given byte array to a string.
 byte[] convert(java.lang.String s)
          Converts the given string to a byte array.
 int convertedLength(java.lang.String s)
          Returns the number of bytes required to store the converted string.
 int getTag()
          Returns the tag of this class.
 
Methods inherited from class org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractString
decode, encode, equals, getString, getValue, hashCode, setString, toString
 
Methods inherited from class org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractType
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1Type
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 

Constructor Detail

ASN1UTF8String

public ASN1UTF8String()
Creates an instance.


ASN1UTF8String

public ASN1UTF8String(java.lang.String s)
Creates an instance with the given string value. No constraints can be set yet so none are checked.

Parameters:
s - The string value.
Method Detail

getTag

public int getTag()
Returns the tag of this class.

Specified by:
getTag in interface ASN1Type
Specified by:
getTag in class ASN1AbstractType
Returns:
The tag.

convert

public java.lang.String convert(byte[] b)
                         throws ASN1Exception
Converts the given byte array to a string. The byte array must be in UTF-8 encoding.

Specified by:
convert in interface ASN1String
Overrides:
convert in class ASN1AbstractString
Parameters:
b - The byte array to convert.
Throws:
ASN1Exception - never, only for compliance with the ASN1String interface.

convert

public byte[] convert(java.lang.String s)
               throws ASN1Exception
Converts the given string to a byte array. The byte array contains the UTF-8 encoding of the given String.

Specified by:
convert in interface ASN1String
Overrides:
convert in class ASN1AbstractString
Parameters:
s - The string to convert.
Throws:
ASN1Exception - never, only for compliance with the ASN1String interface.

convertedLength

public int convertedLength(java.lang.String s)
                    throws ASN1Exception
Returns the number of bytes required to store the converted string.

Specified by:
convertedLength in interface ASN1String
Overrides:
convertedLength in class ASN1AbstractString
Parameters:
s - The string.
Throws:
ASN1Exception - never, only for compliance with the ASN1String interface.