| 1 | Vector streams are similar to STRING streams but use vectors of |
| 2 | (UNSIGNED-BYTE 8) and allow binary as well as character I/O. |
| 3 | |
| 4 | [Type][[BR]] |
| 5 | '''VECTOR-INPUT-STREAM''' |
| 6 | |
| 7 | Type of input vector streams. |
| 8 | |
| 9 | [Type][[BR]] |
| 10 | '''VECTOR-OUTPUT-STREAM''' |
| 11 | |
| 12 | Type of output vector streams. |
| 13 | |
| 14 | [Function][[BR]] |
| 15 | '''MAKE-VECTOR-OUTPUT-STREAM''' `&key external-format` |
| 16 | |
| 17 | Returns a VECTOR-OUTPUT-STREAM. Character output on that |
| 18 | stream is encoded according to the specified external format |
| 19 | (which is handled as it is by other CCL stream classes.) |
| 20 | |
| 21 | [Function][[BR]] |
| 22 | '''GET-OUTPUT-STREAM-VECTOR''' `s` |
| 23 | |
| 24 | S should be a VECTOR-OUTPUT-STREAM. Returns a (SIMPLE-ARRAY |
| 25 | (UNSIGNED-BYTE) (*)) of all bytes written to S since it was |
| 26 | created or since the last call GET-OUTPUT-STREAM-VECTOR on S. |
| 27 | |
| 28 | [Macro][[BR]] |
| 29 | '''WITH-OUTPUT-TO-VECTOR''' `var &optional vector &key external-format &body body` |
| 30 | |
| 31 | Like WITH-OUTPUT-TO-STRING (too much like it, in fact.) |
| 32 | Executes BODY with VAR bound to a VECTOR-OUTPUT-STREAM. If VECTOR is |
| 33 | non-null, it should be a (VECTOR (UNSIGNED-BYTE 8)) with a fill-pointer; |
| 34 | the value(s) returned by BODY are returned and the vector's contents |
| 35 | and fill-pointer are updated at the end of the WITH-OUTPUT-TO-VECTOR form. |
| 36 | If VECTOR is NIL, returns the result of (GET-OUTPUT-STREAM-VECTOR var) after |
| 37 | executing BODY. |
| 38 | |
| 39 | [Macro][[BR]] |
| 40 | '''WITH-INPUT-FROM-VECTOR''' `var vector &key (start 0) end external-format &body body` |
| 41 | |
| 42 | Like WITH-INPUT-FROM-STRING. VECTOR should be a (VECTOR (UNSIGNED-BYTE 8)). |
| 43 | Executes BODY with VAR bound to a VECTOR-INPUT-STREAM constructed from |
| 44 | VECTOR (bounded by START and END.) |
| 45 | |
| 46 | [Function][[BR]] |
| 47 | '''UNSIGNED-INTEGER-TO-BINARY''' `value s` |
| 48 | |
| 49 | Encodes the integer VALUE, which should be non-negative, on the VECTOR-OUTPUT-STREAM S using ULEB128. |
| 50 | |
| 51 | [Function][[BR]] |
| 52 | '''SIGNED-INTEGER-TO-BINARY''' `value s` |
| 53 | |
| 54 | Encodes the integer VALUE on the VECTOR-OUTPUT-STREAM S. Negative integers are encoded in SLEB128 and non-negative integers in ULEB128. |
| 55 | |
| 56 | [Function][[BR]] |
| 57 | '''PARSE-UNSIGNED-INTEGER''' `vector &optional (start 0) end` |
| 58 | |
| 59 | Decodes a ULEB128-encoded integer from the bounded range of VECTOR, |
| 60 | which must be of type (VECTOR (UNSIGNED-BYTE 8)). Returns two |
| 61 | values: that integer and the the index of the first octet in VECTOR |
| 62 | that follows the encoded integer. (The second value will be > start |
| 63 | and <= end) |
| 64 | |
| 65 | [Function][[BR]] |
| 66 | '''PARSE-SIGNED-INTEGER''' `vector &optional (start 0) end` |
| 67 | |
| 68 | As PARSE-UNSIGNED-INTEGER, but assumes SLEB128 encoding and may return |
| 69 | a negative first value. |
| 70 | |
| 71 | [Function][[BR]] |
| 72 | '''PUI-STREAM''' `s` |
| 73 | |
| 74 | Decodes a ULEB128-encoded integer from the VECTOR-INPUT-STREAM S and |
| 75 | returns that value. |
| 76 | |
| 77 | [Function][[BR]] |
| 78 | '''PSI-STREAM''' `s` |
| 79 | |
| 80 | Decodes an SLEB128-encoded integer from the VECTOR-INPUT-STREAM S and |
| 81 | returns that value. |
| 82 | |