Releases: devnied/Bit-lib4j
Releases · devnied/Bit-lib4j
1.6.0
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
- Fix runtime issue on JDK7/8 with ByteBuffer due to JDK 11 build
1.5.1
- Upgrade dependencies
- Replace Travis by Github Action
1.5.0
1.4.13
- Improve performance #6 (Thanks @andrei-cristea)
- Fix dependencies scope #5 (Thanks @anthonygraignic )
1.4.12
- Fix Integer/Long issues with Max and Min value
- Add
clear()method to clear all added data - Add unit tests
1.4.11
1.4.10
1.4.9
- Add method to convert byte to String
bytesToStringNoSpace() - Add method to set a bit in a byte
setBit() - Add unit tests
1.4.8
- Add method to truncate string representation of byte array
bytesToString()