implement readBytesUntilEnd()