public class DefaultAsnOctetsPrintable extends java.lang.Object implements AsnOctetsPrintableFace
When the type is ASN_OCTET_STR, the method tries to guess whether or not the string is printable; without the knowledge of the MIB it cannot distinguish between OctetString and any textual conventions, like DisplayString, InternationalDisplayString or DateAndTime.
Constructor and Description |
---|
DefaultAsnOctetsPrintable() |
Modifier and Type | Method and Description |
---|---|
boolean |
isPrintable(byte[] value)
Returns whether or not the AsnOctets' byte array represent a printable
string or not.
|
java.lang.String |
toInternationalDisplayString(byte[] value)
Returns the String according to the platform's default character set.
|
public boolean isPrintable(byte[] value)
This method can only make a rough guess. There is no way it always gets it right. It is much better to embed MIB knowledge in your implementation, and use toCalendar() or toDisplayString(), than calling toString().
isPrintable
in interface AsnOctetsPrintableFace
AsnOctets.toCalendar()
,
AsnOctets.toDisplayString()
,
AsnOctets.toHex()
,
AsnOctets.toString()
public java.lang.String toInternationalDisplayString(byte[] value)
toInternationalDisplayString
in interface AsnOctetsPrintableFace
AsnOctetsPrintableFace.toInternationalDisplayString(byte[] value)