]> gitweb.factorcode.org Git - factor.git/blob - core/io/streams/byte-array/byte-array-docs.factor
1bc09429dc93e6d4caa8f8433e3a4bec2e597ea9
[factor.git] / core / io / streams / byte-array / byte-array-docs.factor
1 USING: help.syntax help.markup io byte-arrays quotations ;
2 IN: io.streams.byte-array
3
4 ABOUT: "io.streams.byte-array"
5
6 ARTICLE: "io.streams.byte-array" "Byte-array streams"
7 "Byte array streams:"
8 { $subsections
9     <byte-reader>
10     <byte-writer>
11 }
12 "Utility combinators:"
13 { $subsections
14     with-byte-reader
15     with-byte-writer
16 } ;
17
18 HELP: <byte-reader>
19 { $values { "byte-array" byte-array }
20     { "encoding" "an encoding descriptor" }
21     { "stream" "a new byte reader" } }
22 { $description "Creates an input stream reading from a byte array using an encoding." } ;
23
24 HELP: <byte-writer>
25 { $values { "encoding" "an encoding descriptor" }
26     { "stream" "a new byte writer" } }
27 { $description "Creates an output stream writing data to a byte array using an encoding." } ;
28
29 HELP: with-byte-reader
30 { $values { "encoding" "an encoding descriptor" }
31     { "quot" quotation } { "byte-array" byte-array } }
32 { $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." } ;
33
34 HELP: with-byte-writer
35 { $values  { "encoding" "an encoding descriptor" }
36     { "quot" quotation }
37     { "byte-array" byte-array } }
38 { $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." } ;