Introduce method to read from and write to ByteBuffer
Generalize BucketReader/Writer