Is it possible to read/write bits from a file using JAVA?

后端 未结 9 943
一生所求
一生所求 2020-12-09 21:34

To read/write binary files, I am using DataInputStream/DataOutputStream, they have this method writeByte()/readByte(), but what I want to do is read/write bits? Is it possib

9条回答
  •  不知归路
    2020-12-09 22:03

    Afaik there is no function for doing this in the Java API. However you can of course read a byte and then use bit manipulation functions. Same goes for writing.

提交回复
热议问题