support reading unaligned bytes to and from the stream