Relative Content

Tag Archive for ruststreambytebit

Read a slice of bytes &[u8] bit by bit

I’m writing a program for hiding data in PNG files. Due to the lossless compression of PNGs you can slightly modify the colors of a pixel to store data. The problem I have is reading a &[u8] of data bit by bit (in this case two bits but I’d like something that works for multiple bit counts).