Converting a String representation of bits to a byte

前端 未结 3 562
南方客
南方客 2021-02-15 01:48

I\'m just beginning to learn about file compression and I\'ve run into a bit of a roadblock. I have an application that will encode a string such as \"program\" as a compressed

3条回答
  •  生来不讨喜
    2021-02-15 02:35

    I guess, you want to write these zeros and ones as binary values in a file. I so, you can iterate the string taking 8 signs everytime (String.substring() or smth) and create bytes with Byte(String) constructor. It's the easiest solution that comes to my mind for now.

    If i'm not right about the problem, tell more about it please.

提交回复
热议问题