Refine bytestream reader.