/** * Creates an <code>UnsignedInteger32</code> from a <code>long</code> value. * @param value * a <code>long</code> value which must not be greater 2^32-1 and not less * zero. * @throws IllegalArgumentException * if <code>value</code> < 0 or > 2^32-1. */ public UnsignedInteger32(long value) { setValue(value); }
/** * Creates an <code>UnsignedInteger32</code> from a <code>long</code> value. * @param value * a <code>long</code> value which must not be greater 2^32-1 and not less * zero. * @throws IllegalArgumentException * if <code>value</code> < 0 or > 2^32-1. */ public UnsignedInteger32(long value) { setValue(value); }
/** * Creates an unsigned integer from a signed byte value. Negative values * will become 2^7-1 through 2^8-1. * @param signedByteValue * a signed byte value. * @since 1.7 */ public UnsignedInteger32(byte signedByteValue) { setValue(signedByteValue & 0xFF); }
/** * Creates an unsigned integer from a signed int value. Negative values * will become 2^31-1 through 2^32-1. * @param signedIntValue * a signed int value. * @since 1.7 */ public UnsignedInteger32(int signedIntValue) { setValue(signedIntValue & 0xFFFFFFFFL); }
/** * Creates an unsigned integer from a signed byte value. Negative values * will become 2^7-1 through 2^8-1. * @param signedByteValue * a signed byte value. * @since 1.7 */ public UnsignedInteger32(byte signedByteValue) { setValue(signedByteValue & 0xFF); }
/** * Creates an unsigned integer from a signed int value. Negative values * will become 2^31-1 through 2^32-1. * @param signedIntValue * a signed int value. * @since 1.7 */ public UnsignedInteger32(int signedIntValue) { setValue(signedIntValue & 0xFFFFFFFFL); }
/** * Creates an <code>UnsignedInteger32</code> from a <code>long</code> value. * @param value * a <code>long</code> value which must not be greater 2^32-1 and not less * zero. * @throws IllegalArgumentException * if <code>value</code> < 0 or > 2^32-1. */ public UnsignedInteger32(long value) { setValue(value); }
/** * Creates an unsigned integer from a signed int value. Negative values * will become 2^31-1 through 2^32-1. * @param signedIntValue * a signed int value. * @since 1.7 */ public UnsignedInteger32(int signedIntValue) { setValue(signedIntValue & 0xFFFFFFFFL); }
/** * Creates an unsigned integer from a signed byte value. Negative values * will become 2^7-1 through 2^8-1. * @param signedByteValue * a signed byte value. * @since 1.7 */ public UnsignedInteger32(byte signedByteValue) { setValue(signedByteValue & 0xFF); }
public final void setValue(String value) { setValue(Long.parseLong(value)); }
public void setValue(String value) { setValue(Long.parseLong(value)); }
public void setValue(String value) { setValue(Long.parseLong(value)); }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.getUnsigned(0)); }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.getUnsigned(0)); }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.getUnsigned(0)); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); long newValue = BER.decodeUnsignedInteger(inputStream, type); if (type.getValue() != BER.GAUGE) { throw new IOException("Wrong type encountered when decoding Gauge: "+ type.getValue()); } setValue(newValue); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); long newValue = BER.decodeUnsignedInteger(inputStream, type); if (type.getValue() != BER.GAUGE) { throw new IOException("Wrong type encountered when decoding Gauge: "+ type.getValue()); } setValue(newValue); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); long newValue = BER.decodeUnsignedInteger(inputStream, type); if (type.getValue() != BER.GAUGE) { throw new IOException("Wrong type encountered when decoding Gauge: "+ type.getValue()); } setValue(newValue); }
/** * Creates the next sub-index OID value. * @return * a sub-index value corresponding to the seed sub-index type. */ public synchronized OID getNextSubIndex() { if (seedSubIndex instanceof Integer32) { Integer32 i = (Integer32)seedSubIndex; i.setValue(i.getValue()+1); } else if (seedSubIndex instanceof UnsignedInteger32) { UnsignedInteger32 ui = (UnsignedInteger32)seedSubIndex; ui.setValue(ui.getValue()+1); } else if (seedSubIndex instanceof Counter64) { Counter64 c = (Counter64)seedSubIndex; c.setValue(c.getValue()+1); } return seedSubIndex.toSubIndex(impliedLength); } }
/** * Creates the next sub-index OID value. * @return * a sub-index value corresponding to the seed sub-index type. */ public synchronized OID getNextSubIndex() { if (seedSubIndex instanceof Integer32) { Integer32 i = (Integer32)seedSubIndex; i.setValue(i.getValue()+1); } else if (seedSubIndex instanceof UnsignedInteger32) { UnsignedInteger32 ui = (UnsignedInteger32)seedSubIndex; ui.setValue(ui.getValue()+1); } else if (seedSubIndex instanceof Counter64) { Counter64 c = (Counter64)seedSubIndex; c.setValue(c.getValue()+1); } return seedSubIndex.toSubIndex(impliedLength); } }