codec.asn1
Class ASN1UniversalString
java.lang.Object
|
+--codec.asn1.ASN1AbstractType
|
+--codec.asn1.ASN1AbstractString
|
+--codec.asn1.ASN1UniversalString
- All Implemented Interfaces:
- ASN1String, ASN1Type, Cloneable, Externalizable, Serializable
- public class ASN1UniversalString
- extends ASN1AbstractString
Represents a UniversalString. This string type uses a 4-octet encoding of
characters. For more details on strings see
ASN1AbstractString.
- Version:
- "$Id: ASN1UniversalString.java,v 1.2 2000/12/06 17:47:27 vroth Exp $"
- Author:
- Volker Roth
- See Also:
ASN1AbstractString, Serialized Form
|
Method Summary |
String |
convert(byte[] b)
Converts the given byte array to a string by reading four bytes per
character from the array and concatenating them into a Unicode character. |
byte[] |
convert(String s)
Converts the given string to a byte array where each character is
transformed into 4 consecutive bytes. |
int |
convertedLength(String s)
Returns the number of bytes required to store the converted string. |
int |
getTag()
Returns the ASN.1 tag of this type. |
| Methods inherited from class codec.asn1.ASN1AbstractType |
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal |
ASN1UniversalString
public ASN1UniversalString()
ASN1UniversalString
public ASN1UniversalString(String s)
- Creates an instance with the given string value. No constraints could be
set yet so none are checked.
- Parameters:
s - The string value.
getTag
public int getTag()
- Returns the ASN.1
tag of this type.
- Overrides:
getTag in class ASN1AbstractType
- Returns:
- The tag value.
convert
public String convert(byte[] b)
throws ASN1Exception
- Converts the given byte array to a string by reading four bytes per
character from the array and concatenating them into a Unicode character.
- Overrides:
convert in class ASN1AbstractString
- Parameters:
b - The byte array to convert.
convert
public byte[] convert(String s)
- Converts the given string to a byte array where each character is
transformed into 4 consecutive bytes.
- Overrides:
convert in class ASN1AbstractString
- Parameters:
s - The string to convert.
convertedLength
public int convertedLength(String s)
- 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.