I need a high level Java library to work with Bits (without shifting) and Bytes.

Ideally it should

  • Avoid working directly with ByteBuffer, DataInputStream
  • Work with unsigned values easily
  • (optional) Decrypt/Encrypt
  • (optional) calculate crc
  • Using predefined binary formats

I worked with a Scala library called scodec.

Is there something similar for Java?

Prone and java-binary-block-parser that seems meet requirements.

Please advice options and share experiences

Thanks in advance

  • What do you mean with Decrypt/Encrypt? What encryption? – Nicolas Raoul Mar 28 '16 at 8:26
  • thank you for the answer @Nicolas Raoul. Scodec has great functions for encryption e.g. def encrypted[A](codec: Codec[A])(implicit cipherFactory: CipherFactory) where you give Codec and CipherFactory e.g CipherFactory("AES/CBC/NoPadding", new SecretKeySpec(key, "AES"), new IvParameterSpec(initialVector)). that is all to decode/encode and encrypt/decrypt AES CBC. but it is optional. for now I need good java library to do plain encoding/decoding lot little predefined packges – Alex Mar 28 '16 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.