codec.asn1
Class ASN1BMPString

java.lang.Object
  extended by codec.asn1.ASN1AbstractType
      extended by codec.asn1.ASN1AbstractString
          extended by codec.asn1.ASN1BMPString
All Implemented Interfaces:
ASN1String, ASN1Type, Cloneable

public class ASN1BMPString
extends ASN1AbstractString

Represents a BMPString. This string type uses a 2-octet encoding of characters. For more details on strings see ASN1AbstractString.

Version:
"$Id: ASN1BMPString.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth
See Also:
ASN1AbstractString

Constructor Summary
ASN1BMPString()
           
ASN1BMPString(String s)
          Creates an instance with the given string value.
 
Method Summary
 String convert(byte[] b)
          Converts the given byte array to a string by filling up each consecutive 2-byte-tuple with 0's to the size of the Unicode characters.
 byte[] convert(String s)
          Converts the given string to a byte array by chopping away all but the two least significant byte of each character.
 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 which is [UNIVERSAL 30].
 
Methods inherited from class codec.asn1.ASN1AbstractString
decode, encode, getString, getValue, setString, setString0, toString
 
Methods inherited from class codec.asn1.ASN1AbstractType
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface codec.asn1.ASN1Type
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 

Constructor Detail

ASN1BMPString

public ASN1BMPString()

ASN1BMPString

public ASN1BMPString(String s)
Creates an instance with the given string value. The string value is subject to constraint checks.

This constructor calls setString to set the string value.

Parameters:
The - string value.
Method Detail

getTag

public int getTag()
Returns the ASN.1 tag of this type which is [UNIVERSAL 30].

Specified by:
getTag in interface ASN1Type
Specified by:
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 filling up each consecutive 2-byte-tuple with 0's to the size of the Unicode characters.

Specified by:
convert in interface ASN1String
Overrides:
convert in class ASN1AbstractString
Parameters:
b - The byte array to convert.
Throws:
ASN1Exception

convert

public byte[] convert(String s)
               throws ASN1Exception
Converts the given string to a byte array by chopping away all but the two least significant byte of each character.

Specified by:
convert in interface ASN1String
Overrides:
convert in class ASN1AbstractString
Parameters:
s - The string to convert.
Throws:
ASN1Exception

convertedLength

public int convertedLength(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


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.