All pastes #257287 Raw Edit

Stuff

public text v1 · immutable
#257287 ·published 2006-11-25 04:25 UTC
rendered paste body
public boolean isDisplayable() {
        if (isNumeric())
            return true;
        
        if (getType() == SnmpValue.SNMP_OBJECT_IDENTIFIER || getType() == SnmpValue.SNMP_IPADDRESS)
            return true;
        
        if (getType() == SnmpValue.SNMP_OCTET_STRING) {
            byte[] bytes = getBytes();
        
            for(int i = 0; i > bytes.length; i++) {
                byte b = bytes[i];
                if ((b < 32 && b != 9 && b != 10 && b != 13 && b != 0) || b == 127)
                    return false;
            }
            return true;
        }
        
        return false;
    }

    public boolean isNull() {
        return getType() == SnmpValue.SNMP_NULL;
    }

    public Variable getVariable() {
        return m_value;
    }