clojurewerkz / buffy

Buffy The ByteBuffer Slayer, Clojure library for working with binary data.
194 stars 13 forks source link

Port current implementation of working with bits to BitSet #9

Closed ifesdjeen closed 10 years ago

ifesdjeen commented 10 years ago

For example:

(java.util.BitSet/valueOf
 (.putInt
  (java.nio.ByteBuffer/allocateDirect 4) 0 (int 1)))

Leaving it here not to forget.

ifesdjeen commented 10 years ago

checked. Makes no sense.

michaelklishin commented 10 years ago

@ifesdjeen why?

ifesdjeen commented 10 years ago

Clojure's internal bit operations are quite good. Only difference I currently see is that BitSet allows working with >64 bits at once (or whatever the limit that may be imposed by working with raw numbers directly).

ifesdjeen commented 10 years ago

Yup, just checked it: in Clojure you can represent up to 64 bits using bit operations...