Converting a String representation of bits to a byte

前端 未结 3 1312
小蘑菇
小蘑菇 2021-02-15 02:02

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:17

    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.

提交回复
热议问题