Skip to content

1.6.0

Latest

Choose a tag to compare

@devnied devnied released this 08 Feb 00:41
· 2 commits to master since this release

Performance

  • Replace Math.pow(2, n) with bitwise shift 1L << n in setNextValue
  • Replace Long.toBinaryString().length() with Long.numberOfLeadingZeros() in setNextValue
  • Replace Math.ceil(x / BYTE_SIZE_F) with integer arithmetic (x + BYTE_SIZE - 1) / BYTE_SIZE
  • Remove unnecessary ByteBuffer allocation in getNextLong and setNextByte
  • Replace BigInteger-based toBinary() with direct bit manipulation loop in BytesUtils
  • Use Arrays.copyOf instead of manual array allocation + System.arraycopy

Bug Fixes

  • Fix boundary clamping in setNextValue: values exactly equal to 2^n are now correctly clamped to 2^n - 1
  • Fix 1L << 63 overflow: guard against negative bitMax when writing 64-bit values
  • Fix charset inconsistency: setNextString now uses DEFAULT_CHARSET (ASCII) instead of Charset.defaultCharset(), matching getNextString behavior