USING: byte-arrays byte-vectors kernel io.encodings io.streams.string sequences io namespaces io.encodings.private accessors ; IN: io.streams.byte-array : ( encoding -- stream ) 512 swap ; : with-byte-writer ( encoding quot -- byte-array ) [ ] dip [ output-stream get ] compose with-output-stream* dup encoder? [ stream>> ] when >byte-array ; inline : ( byte-array encoding -- stream ) [ >byte-vector dup reverse-here ] dip ; : with-byte-reader ( byte-array encoding quot -- ) [ ] dip with-input-stream* ; inline