codec.asn1
Class ASN1UTF8String

java.lang.Object
  |
  +--codec.asn1.ASN1AbstractType
        |
        +--codec.asn1.ASN1AbstractString
              |
              +--codec.asn1.ASN1UTF8String
All Implemented Interfaces:
ASN1String, ASN1Type, Cloneable, Externalizable, Serializable

public class ASN1UTF8String
extends ASN1AbstractString

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

Version:
"$Id: ASN1UTF8String.java,v 1.4 2004/08/09 07:51:39 flautens Exp $"
Author:
Volker Roth
See Also:
Serialized Form

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

Constructor Detail

ASN1UTF8String

public ASN1UTF8String()
Creates an instance.

ASN1UTF8String

public ASN1UTF8String(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.
Overrides:
getTag in class ASN1AbstractType
Returns:
The tag.

setString0

protected void setString0(String s)
Overrides:
setString0 in class ASN1AbstractString

convert

public String convert(byte[] b)
               throws ASN1Exception
Converts the given byte array to a string. The byte array must be in UTF-8 encoding.
Overrides:
convert in class ASN1AbstractString
Parameters:
b - The byte array to convert.

convert

public byte[] convert(String s)
               throws ASN1Exception
Converts the given string to a byte array. The byte array contains the UTF-8 encoding of the given String.
Overrides:
convert in class ASN1AbstractString
Parameters:
s - The string to convert.

convertedLength

public int convertedLength(String s)
                    throws ASN1Exception
Returns the number of bytes required to store the converted string.
Overrides:
convertedLength in class ASN1AbstractString
Parameters:
s - The string.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.