Read and write bit streams