FileDocCategorySizeDatePackage
SnmpOpaque.javaAPI DocJava SE 5 API2182Fri Aug 26 14:55:04 BST 2005com.sun.jmx.snmp

SnmpOpaque

public class SnmpOpaque extends SnmpString
Is used to represent an SNMP value. The Opaque type is defined in RFC 1155.

This API is a Sun Microsystems internal API and is subject to change without notice.

version
4.8 12/19/03
author
Sun Microsystems, Inc

Fields Summary
static final String
name
Name of the type.
Constructors Summary
public SnmpOpaque(byte[] v)
Constructs a new SnmpOpaque from the specified bytes array.

param
v The bytes composing the opaque value.

	super(v) ;
    
public SnmpOpaque(Byte[] v)
Constructs a new SnmpOpaque with the specified Bytes array.

param
v The Bytes composing the opaque value.

	super(v) ;
    
public SnmpOpaque(String v)
Constructs a new SnmpOpaque from the specified String value.

param
v The initialization value.

	super(v) ;
    
Methods Summary
public final java.lang.StringgetTypeName()
Returns a textual description of the type object.

return
ASN.1 textual description.

        return name ;
    
public java.lang.StringtoString()
Converts the opaque to its String form, that is, a string of bytes expressed in hexadecimal form.

return
The String representation of the value.

	StringBuffer result = new StringBuffer() ;
	for (int i = 0 ; i < value.length ; i++) {
	    byte b = value[i] ;
	    int n = (b >= 0) ? b : b + 256 ;
	    result.append(Character.forDigit(n / 16, 16)) ;
	    result.append(Character.forDigit(n % 16, 16)) ;
	}
	return result.toString() ;