Package uk.co.westhawk.snmp.stack
Class DefaultAsnOctetsPrintable
java.lang.Object
uk.co.westhawk.snmp.stack.DefaultAsnOctetsPrintable
- All Implemented Interfaces:
AsnOctetsPrintableFace
Default implementation of AsnOctetsPrintableFace.
This class has no effect on the way AsnOctets with type IPADDRESS
or OPAQUE are printed.
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.
- Since:
- 4_14
- Version:
- $Revision: 3.3 $ $Date: 2006/01/17 17:43:54 $
- Author:
- Birgit Arkesteijn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isPrintable
(byte[] value) Returns whether or not the AsnOctets' byte array represent a printable string or not.toInternationalDisplayString
(byte[] value) Returns the String according to the platform's default character set.
-
Constructor Details
-
DefaultAsnOctetsPrintable
public DefaultAsnOctetsPrintable()
-
-
Method Details
-
isPrintable
public boolean isPrintable(byte[] value) Returns whether or not the AsnOctets' byte array represent a printable string or not.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().
- Specified by:
isPrintable
in interfaceAsnOctetsPrintableFace
- See Also:
-
toInternationalDisplayString
Returns the String according to the platform's default character set.- Specified by:
toInternationalDisplayString
in interfaceAsnOctetsPrintableFace
- See Also:
-