Package com.oss.asn1
Class UTF8String
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractString
com.oss.asn1.UTF8String
- All Implemented Interfaces:
com.oss.asn1.Sizeable
,Serializable
,Cloneable
The UTF8String class represents the ASN.1 UTF8String type.
- Since:
- ASN.1/Java 6.0
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.UTF8String
(byte[] value) Construct from a byte array.UTF8String
(char[] value) Construct from a char array.UTF8String
(int[] value) Construct from an int array.UTF8String
(String value) Construct from a String. -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]
Get the value of 'this' object as an array of bytes.clone()
Clone 'this' object.int
getSize()
Used to get the number of Unicode code points of 'this' object.Returns the name of ASN.1 type this java class represents.int
hashCode()
Returns a hash code for this objectfinal int[]
Get the value of 'this' object as an array of int.void
setValue
(byte[] value) Set the value of 'this' object to a byte array.final void
setValue
(char[] value) Set the value of 'this' object to an array of char.final void
setValue
(int[] value) Set the value of 'this' object to an array of char.final void
Set the value of 'this' object to a String.final String
Get the value of 'this' object as a String.Methods inherited from class com.oss.asn1.AbstractString
compareTo, equalTo, getLength
Methods inherited from class com.oss.asn1.AbstractData
delete, equals, isEncodable, isPDU, isValid, toString, toString
-
Constructor Details
-
UTF8String
public UTF8String()The default constructor. -
UTF8String
public UTF8String(byte[] value) Construct from a byte array.- Parameters:
value
- the char array to set 'this' object to.
-
UTF8String
Construct from a String.- Parameters:
value
- the String to set 'this' object to.
-
UTF8String
public UTF8String(char[] value) Construct from a char array.- Parameters:
value
- the char array to set 'this' object to.
-
UTF8String
public UTF8String(int[] value) Construct from an int array.- Parameters:
value
- the int array to set 'this' object to.
-
-
Method Details
-
setValue
public void setValue(byte[] value) Set the value of 'this' object to a byte array.- Parameters:
value
- the byte array to set this object to.
-
setValue
Set the value of 'this' object to a String.- Specified by:
setValue
in classAbstractString
- Parameters:
value
- the value to set 'this' object to.
-
setValue
public final void setValue(char[] value) Set the value of 'this' object to an array of char.- Specified by:
setValue
in classAbstractString
- Parameters:
value
- the value to set 'this' object to.
-
setValue
public final void setValue(int[] value) Set the value of 'this' object to an array of char.- Parameters:
value
- the value to set 'this' object to.
-
byteArrayValue
public final byte[] byteArrayValue()Get the value of 'this' object as an array of bytes.- Returns:
- primitive value of 'this' object as byte[].
-
stringValue
Get the value of 'this' object as a String.- Specified by:
stringValue
in classAbstractString
- Returns:
- the String value of 'this' object.
-
intArrayValue
public final int[] intArrayValue()Get the value of 'this' object as an array of int.- Returns:
- int[] value of 'this' object.
-
getSize
public int getSize()Used to get the number of Unicode code points of 'this' object.- Specified by:
getSize
in interfacecom.oss.asn1.Sizeable
- Specified by:
getSize
in classAbstractString
- Returns:
- the number of Unicode code points in 'this' string.
-
clone
Clone 'this' object.- Returns:
- deep copy of 'this' object.
-
getTypeName
Returns the name of ASN.1 type this java class represents.- Overrides:
getTypeName
in classAbstractData
- Returns:
- the name of the ASN.1 type.
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractString
- Returns:
- a hash code for this object
-