public byte[] asBytes() { byte[] bytes = new byte[16]; ByteBuffer buf = ByteBuffer.wrap(bytes); buf.putLong(getMostSignificantBits()); buf.putLong(getLeastSignificantBits()); return bytes; }
@Override public void parse(ByteBuffer b, Data data) { data.putDecimal128(new Decimal128(b.getLong(), b.getLong())); } }
public Decimal128(final long msb, final long lsb) { _msb = msb; _lsb = lsb; _underlying = calculateBigDecimal(msb, lsb); }
public Decimal128(BigDecimal underlying) { _underlying = underlying; _msb = calculateMostSignificantBits(underlying); _lsb = calculateLeastSignificantBits(underlying); }
msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue());
public Decimal128(BigDecimal underlying) { _underlying = underlying; _msb = calculateMostSignificantBits(underlying); _lsb = calculateLeastSignificantBits(underlying); }
msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue());
public byte[] asBytes() { byte[] bytes = new byte[16]; ByteBuffer buf = ByteBuffer.wrap(bytes); buf.putLong(getMostSignificantBits()); buf.putLong(getLeastSignificantBits()); return bytes; }
@Override public void parse(ByteBuffer b, Data data) { data.putDecimal128(new Decimal128(b.getLong(), b.getLong())); } }
public Decimal128(BigDecimal underlying) { _underlying = underlying; _msb = calculateMostSignificantBits(underlying); _lsb = calculateLeastSignificantBits(underlying); }
msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue());
public Decimal128(final long msb, final long lsb) { _msb = msb; _lsb = lsb; _underlying = calculateBigDecimal(msb, lsb); }
public byte[] asBytes() { byte[] bytes = new byte[16]; ByteBuffer buf = ByteBuffer.wrap(bytes); buf.putLong(getMostSignificantBits()); buf.putLong(getLeastSignificantBits()); return bytes; }
@Override public void parse(ByteBuffer b, Data data) { data.putDecimal128(new Decimal128(b.getLong(), b.getLong())); } }
msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue());
public Decimal128(final long msb, final long lsb) { _msb = msb; _lsb = lsb; _underlying = calculateBigDecimal(msb, lsb); }
@Override public int encode(ByteBuffer b) { int size = size(); if(b.remaining()>=size) { if(size == 17) { b.put((byte)0x94); } b.putLong(_value.getMostSignificantBits()); b.putLong(_value.getLeastSignificantBits()); return size; } else { return 0; } } }
public Decimal128 readValue() { long msb = getDecoder().readRawLong(); long lsb = getDecoder().readRawLong(); return new Decimal128(msb, lsb); } }
msg.setStringProperty(key, value.toString()); } else if( value instanceof Decimal128 ) { msg.setDoubleProperty(key, ((Decimal128)value).doubleValue()); } else if( value instanceof Decimal64 ) { msg.setDoubleProperty(key, ((Decimal64)value).doubleValue());
@Override public int encode(ByteBuffer b) { int size = size(); if(b.remaining()>=size) { if(size == 17) { b.put((byte)0x94); } b.putLong(_value.getMostSignificantBits()); b.putLong(_value.getLeastSignificantBits()); return size; } else { return 0; } } }