All Projects → devnied → Bit-lib4j

devnied / Bit-lib4j

Licence: Apache-2.0 license
Useful library to handle bytes or bits in Java. Read and write data in a byte array with a custom size for Java types. Read/Write Integer, Long, signed data, String, Hexa String and Date bit to bit

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bit-lib4j

Ewahboolarray
A compressed bitmap class in C++.
Stars: ✭ 381 (+618.87%)
Mutual labels:  bitset
Roaring
Roaring bitmaps in Go (golang)
Stars: ✭ 1,118 (+2009.43%)
Mutual labels:  bitset
Fastbitset.js
Speed-optimized BitSet implementation for modern browsers and JavaScript engines
Stars: ✭ 118 (+122.64%)
Mutual labels:  bitset
Javaewah
A compressed alternative to the Java BitSet class
Stars: ✭ 474 (+794.34%)
Mutual labels:  bitset
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-33.96%)
Mutual labels:  bitset
Cbitset
A simple bitset library in C
Stars: ✭ 73 (+37.74%)
Mutual labels:  bitset
bitset2
std::bitset with constexpr implementations plus additional features.
Stars: ✭ 76 (+43.4%)
Mutual labels:  bitset
Roaringbitmap
A better compressed bitset in Java
Stars: ✭ 2,460 (+4541.51%)
Mutual labels:  bitset
Csharpewah
Compressed bitmaps in C#
Stars: ✭ 59 (+11.32%)
Mutual labels:  bitset
Bit
Bitset data structure
Stars: ✭ 100 (+88.68%)
Mutual labels:  bitset
Bitset
Go package implementing bitsets
Stars: ✭ 649 (+1124.53%)
Mutual labels:  bitset
Bitvector
Uncompressed, dynamically resizeable bitset for Kotlin (JS/JVM/Android)
Stars: ✭ 12 (-77.36%)
Mutual labels:  bitset
Hibitset
Hierarchical bit set container
Stars: ✭ 81 (+52.83%)
Mutual labels:  bitset
Bitvec
A crate for managing memory bit by bit
Stars: ✭ 411 (+675.47%)
Mutual labels:  bitset
Pyroaringbitmap
An efficient and light-weight ordered set of 32 bits integers.
Stars: ✭ 128 (+141.51%)
Mutual labels:  bitset
Mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
Stars: ✭ 321 (+505.66%)
Mutual labels:  bitset
Roaringbitmap
Roaring Bitmap in Cython
Stars: ✭ 64 (+20.75%)
Mutual labels:  bitset
Bitter
A Swift Bits Manipulation/Bitwise Operations Toolkit
Stars: ✭ 197 (+271.7%)
Mutual labels:  bitset
Bitset.js
An arbitrary size Bit-Vector implementation in JavaScript
Stars: ✭ 177 (+233.96%)
Mutual labels:  bitset
Croaring Rs
Rust wrapper for CRoaring
Stars: ✭ 89 (+67.92%)
Mutual labels:  bitset

Bit-lib4j Bit-lib4j CI Coverage Status Maven Central

Bit-Lib4j is an useful library to handle bytes or bits in Java.
With this library you can read/write data in a byte array with a custom size for Java primitive types.

Simple API

It is very easy to get started with bit-lib4j:

  • Read data from byte array
	byte[] array = new byte[]{0x12,0x25}
	BitUtils bit = new BitUtils(array);
	int res = bit.getNextInteger(4);        // read the first 4 bits to an integer
  • Create byte array with bit
	BitUtils bit = new BitUtils(8);
	bit.setNextInteger(3,3);        // set an integer on 3 bits
	bit.setNextInteger(1,5);        // set one value on 5 bits

	// Result
	bit.getData();                  // return Ox61  (0110 0001b)
  • Read/write signed values
	BitUtils bit = new BitUtils(4);
	bit.setNextInteger(-2 , 4);	    // set an integer (-2) on 4 bits

	// Result
	bit.getNextIntegerSigned(4);    // return -2

You can also use getNextSignedLong() to handle long signed values.

Handle bytes more easily

The class ByteUtils provided static methods to convert byte array to String, String to byte array, int to byte array, byte array to binary representation.

More documentation into the wiki

Download

Maven

<dependency>
  <groupId>com.github.devnied</groupId>
  <artifactId>bit-lib4j</artifactId>
  <version>1.5.2</version>
</dependency>

JAR

You can download this library on Maven central or in Github release tab

Dependencies

If you are not using Maven or some other dependency management tool that can understand Maven repositories, the list below is what you need to run bit-lib4j.

Runtime Dependencies

  • slf4j-api 1.7.30

Bugs

Please report bugs and feature requests to the GitHub issue tracker.
Forks and Pull Requests are also welcome.

Author

Millau Julien

Copyright and license

Copyright 2020 Millau Julien.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Analytics

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].