Skip to content

Releases: devnied/Bit-lib4j

1.6.0

08 Feb 00:41

Choose a tag to compare

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

1.5.2

01 May 20:09

Choose a tag to compare

  • Fix runtime issue on JDK7/8 with ByteBuffer due to JDK 11 build

1.5.1

01 May 20:07

Choose a tag to compare

  • Upgrade dependencies
  • Replace Travis by Github Action

1.5.0

05 Aug 12:40

Choose a tag to compare

  • Add support of Signed values (see #7)

Two new methods available to handle signed values:

  • getNextLongSigned()
  • getNextIntegerSigned()

1.4.13

03 Apr 19:34

Choose a tag to compare

1.4.12

30 Nov 20:24

Choose a tag to compare

  • Fix Integer/Long issues with Max and Min value
  • Add clear() method to clear all added data
  • Add unit tests

1.4.11

25 Nov 21:11

Choose a tag to compare

  • Fix Integer size issue (#4)
  • Add getNextLong() and setNextLong() for Long
  • Add unit tests

1.4.10

23 Jul 09:53

Choose a tag to compare

  • Remove matchBitByValue() method (#3)
  • Fix matchBitByBitIndex() for Integer (#3)
  • Add unit tests

1.4.9

23 Jul 09:59

Choose a tag to compare

  • Add method to convert byte to String bytesToStringNoSpace()
  • Add method to set a bit in a byte setBit()
  • Add unit tests

1.4.8

23 Jul 10:02

Choose a tag to compare

  • Add method to truncate string representation of byte array bytesToString()