Skip to content

Releases: devnied/Bit-lib4j

1.6.0

Choose a tag to compare

@devnied devnied released this 08 Feb 00:41

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

Choose a tag to compare

@devnied devnied released this 01 May 20:09
  • Fix runtime issue on JDK7/8 with ByteBuffer due to JDK 11 build

1.5.1

Choose a tag to compare

@devnied devnied released this 01 May 20:07
  • Upgrade dependencies
  • Replace Travis by Github Action

1.5.0

Choose a tag to compare

@devnied devnied released this 05 Aug 12:40
  • Add support of Signed values (see #7)

Two new methods available to handle signed values:

  • getNextLongSigned()
  • getNextIntegerSigned()

1.4.13

Choose a tag to compare

@devnied devnied released this 03 Apr 19:34

1.4.12

Choose a tag to compare

@devnied devnied released this 30 Nov 20:24
  • Fix Integer/Long issues with Max and Min value
  • Add clear() method to clear all added data
  • Add unit tests

1.4.11

Choose a tag to compare

@devnied devnied released this 25 Nov 21:11
  • Fix Integer size issue (#4)
  • Add getNextLong() and setNextLong() for Long
  • Add unit tests

1.4.10

Choose a tag to compare

@devnied devnied released this 23 Jul 09:53
  • Remove matchBitByValue() method (#3)
  • Fix matchBitByBitIndex() for Integer (#3)
  • Add unit tests

1.4.9

Choose a tag to compare

@devnied devnied released this 23 Jul 09:59
  • Add method to convert byte to String bytesToStringNoSpace()
  • Add method to set a bit in a byte setBit()
  • Add unit tests

1.4.8

Choose a tag to compare

@devnied devnied released this 23 Jul 10:02
  • Add method to truncate string representation of byte array bytesToString()