1 USING: help.syntax help.markup io byte-arrays quotations ;
2 IN: io.streams.byte-array
4 ABOUT: "io.streams.byte-array"
6 ARTICLE: "io.streams.byte-array" "Byte-array streams"
8 { $subsection <byte-reader> }
9 { $subsection <byte-writer> }
10 "Utility combinators:"
11 { $subsection with-byte-reader }
12 { $subsection with-byte-writer } ;
15 { $values { "byte-array" byte-array }
16 { "encoding" "an encoding descriptor" }
17 { "stream" "a new byte reader" } }
18 { $description "Creates an input stream reading from a byte array using an encoding." } ;
21 { $values { "encoding" "an encoding descriptor" }
22 { "stream" "a new byte writer" } }
23 { $description "Creates an output stream writing data to a byte array using an encoding." } ;
25 HELP: with-byte-reader
26 { $values { "encoding" "an encoding descriptor" }
27 { "quot" quotation } { "byte-array" byte-array } }
28 { $description "Calls the quotation in a new dynamic scope with " { $link input-stream } " rebound to an input stream for reading from a byte array using an encoding." } ;
30 HELP: with-byte-writer
31 { $values { "encoding" "an encoding descriptor" }
33 { "byte-array" byte-array } }
34 { $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to an output stream writing data to a byte array using an encoding." } ;