/** * Write the given byte array to the ArrowBuf at the given value index. Will throw an * UnsupportedOperationException if the decimal size is greater than the Decimal vector byte * width. */ public static void writeByteArrayToArrowBuf(byte[] bytes, ArrowBuf bytebuf, int index) { writeByteArrayToArrowBuf(bytes, bytebuf, index, 0); }
/** * Write the given BigDecimal to the ArrowBuf at the given value index. Will throw an * UnsupportedOperationException if the decimal size is greater than the Decimal vector byte * width. */ public static void writeBigDecimalToArrowBuf(BigDecimal value, ArrowBuf bytebuf, int index) { final byte[] bytes = value.unscaledValue().toByteArray(); final int padValue = value.signum() == -1 ? 0xFF : 0; writeByteArrayToArrowBuf(bytes, bytebuf, index, padValue); }