Here you can find the source of toByteBuffer(BigDecimal decimal)
public static ByteBuffer toByteBuffer(BigDecimal decimal)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.nio.ByteBuffer; public class Main { public static ByteBuffer toByteBuffer(BigDecimal decimal) { return ByteBuffer.wrap(decimal.unscaledValue().toByteArray()); }/*from w w w . jav a 2s .co m*/ }