public class CIMOctetString extends Object
Constructor and Description |
---|
CIMOctetString(String pString,
boolean pIsHex)
Constructs a
CIMOctetString from the given string. |
CIMOctetString(UnsignedInteger8[] pBytes)
Constructs a
CIMOctetString from the given byte array. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object pObj)
Takes a CIM octet string and returns
true if it is equal to
this CIM octet string. |
String |
getASCIIString(char pReplacementChar)
Returns ASCII string representation of octet string with non-printable
characters replaced by
pReplacementChar . |
UnsignedInteger8[] |
getBytes()
Returns byte array representation of octet string.
|
String |
getHexString()
Returns hexadecimal string representation of octet string.
|
int |
hashCode()
Returns hash code value for octet string.
|
int |
length()
Returns length of octet string, where length is number of octets plus
four.
|
String |
toString()
Returns string representation of octet string.
|
public CIMOctetString(UnsignedInteger8[] pBytes) throws IllegalArgumentException
CIMOctetString
from the given byte array.pBytes
- Byte array representation of octet string.IllegalArgumentException
public CIMOctetString(String pString, boolean pIsHex) throws IllegalArgumentException
CIMOctetString
from the given string.pString
- String representation of octet string.pIsHex
- true
if string is hexadecimal string,
false
if string is ASCII string.IllegalArgumentException
public boolean equals(Object pObj)
true
if it is equal to
this CIM octet string. Otherwise, it returns false
. Two
octet strings are considered equal if all of their common representations
are equal. If the octet strings have no representations in common, this
method will build the missing one, starting with byte array and then
hexadecmial string.
NOTE: The ASCII string representation is only considered if both octet
strings were constructed with an ASCII string.public String getASCIIString(char pReplacementChar)
pReplacementChar
. If the ASCII string
has not yet been created, it is created from the byte array or
hexadecimal string.pReplacementChar
- Replacement character for non-printable characters which must
be between 0x20 and 0x7E, inclusive.public UnsignedInteger8[] getBytes()
public String getHexString()
public int hashCode()
public int length()
Copyright © 2005, 2012 IBM Corporation. All Rights Reserved.