@Override public void parse(ByteBuffer b, Data data) { data.putDecimal32(new Decimal32(b.getInt())); } }
public Decimal32(final int bits) { _bits = bits; _underlying = calculateBigDecimal(bits); }
public Decimal32(BigDecimal underlying) { _underlying = underlying; _bits = calculateBits( underlying ); }
@Override public int encode(ByteBuffer b) { int size = size(); if(b.remaining()>=size) { if(size == 5) { b.put((byte)0x74); } b.putInt(_value.getBits()); return size; } else { return 0; } } }
msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { msg.setStringProperty(key, value.toString());
@Override public int encode(ByteBuffer b) { int size = size(); if(b.remaining()>=size) { if(size == 5) { b.put((byte)0x74); } b.putInt(_value.getBits()); return size; } else { return 0; } } }
msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { msg.setStringProperty(key, value.toString());
@Override public void parse(ByteBuffer b, Data data) { data.putDecimal32(new Decimal32(b.getInt())); } }
@Override public int encode(ByteBuffer b) { int size = size(); if(b.remaining()>=size) { if(size == 5) { b.put((byte)0x74); } b.putInt(_value.getBits()); return size; } else { return 0; } } }
msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { msg.setStringProperty(key, value.toString());
public Decimal32(BigDecimal underlying) { _underlying = underlying; _bits = calculateBits( underlying ); }
public Decimal32(final int bits) { _bits = bits; _underlying = calculateBigDecimal(bits); }
@Override public void parse(ByteBuffer b, Data data) { data.putDecimal32(new Decimal32(b.getInt())); } }
public void writeValue(final Decimal32 val) { getEncoder().writeRaw(val.getBits()); }
msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { msg.setStringProperty(key, value.toString());
public Decimal32(BigDecimal underlying) { _underlying = underlying; _bits = calculateBits( underlying ); }
public Decimal32(final int bits) { _bits = bits; _underlying = calculateBigDecimal(bits); }
public Decimal32 readValue() { return new Decimal32(getDecoder().readRawInt()); } }
public void writeValue(final Decimal32 val) { getEncoder().writeRaw(val.getBits()); }
msg.setDoubleProperty(key, ((Decimal64)value).doubleValue()); } else if( value instanceof Decimal32 ) { msg.setFloatProperty(key, ((Decimal32)value).floatValue()); } else if( value instanceof Binary ) { msg.setStringProperty(key, value.toString());