Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Please recommend a java library for byte/bit manipulation ?  RSS feed

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We're starting a java application which includes data streaming & processing. It relies on home-made algorithms that require various byte/bit maniuplation - lots of bitwize operators, shifts, xors etc, working on large chunks of data, with some performance requirements.

Could anyone please recommend a good 3rd party java library for this (open-source *or* commercial)?
We're willing to consider both JNI and pure-java approaches.

Some examples of the type of operators this library should implement (just to give a general idea ):

1) Given a byte[] of size 1MB, perform a "shift-right" on the entire chunk of data as a whole.

2) Given a large byte array, convert it from 'high endian' representation to 'low endian' .

3) Provide a class similar to java BitSet (especially, the ability to set/reset a given bit), but expand it so that programmers can have direct access to the 'private' data storage (with is long[]), for performance reasons.

These are just examples - the general idea pointing at low level, bitwize operations, with performance in mind, and support for streaming or handling large byte arrays.

We'd appreciate any recommendations.
Thanks
[ May 08, 2007: Message edited by: Sol Mam-Orn ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt that there's any library that does any of these, since they are so easy to implement on top of the bit operations the Java language already supports. Also, my guess is that using JNI would be a significant slowdown.

If you need BitSet to do something it doesn't do now, you could extend it.
 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!