Changes between Initial Version and Version 1 of VectorStreams


Ignore:
Timestamp:
Mar 18, 2010, 2:06:10 PM (10 years ago)
Author:
gz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VectorStreams

    v1 v1  
     1Vector 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
     7Type of input vector streams.
     8
     9[Type][[BR]]
     10'''VECTOR-OUTPUT-STREAM'''
     11
     12Type of output vector streams.
     13
     14[Function][[BR]]
     15'''MAKE-VECTOR-OUTPUT-STREAM''' `&key external-format`
     16
     17Returns a VECTOR-OUTPUT-STREAM. Character output on that
     18stream 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
     24S should be a VECTOR-OUTPUT-STREAM. Returns a (SIMPLE-ARRAY
     25(UNSIGNED-BYTE) (*)) of all bytes written to S since it was
     26created 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
     31Like WITH-OUTPUT-TO-STRING (too much like it, in fact.)
     32Executes BODY with VAR bound to a VECTOR-OUTPUT-STREAM. If VECTOR is
     33non-null, it should be a (VECTOR (UNSIGNED-BYTE 8)) with a fill-pointer;
     34the value(s) returned by BODY are returned and the vector's contents
     35and fill-pointer are updated at the end of the WITH-OUTPUT-TO-VECTOR form.
     36If VECTOR is NIL, returns the result of (GET-OUTPUT-STREAM-VECTOR var) after
     37executing BODY.
     38
     39[Macro][[BR]]
     40'''WITH-INPUT-FROM-VECTOR''' `var vector &key (start 0) end external-format &body body`
     41
     42Like WITH-INPUT-FROM-STRING. VECTOR should be a (VECTOR (UNSIGNED-BYTE 8)).
     43Executes BODY with VAR bound to a VECTOR-INPUT-STREAM constructed from
     44VECTOR (bounded by START and END.)
     45
     46[Function][[BR]]
     47'''UNSIGNED-INTEGER-TO-BINARY''' `value s`
     48
     49Encodes 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
     54Encodes 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
     59Decodes a ULEB128-encoded integer from the bounded range of VECTOR,
     60which must be of type (VECTOR (UNSIGNED-BYTE 8)). Returns two
     61values: that integer and the the index of the first octet in VECTOR
     62that follows the encoded integer. (The second value will be > start
     63and <= end)
     64
     65[Function][[BR]]
     66'''PARSE-SIGNED-INTEGER''' `vector &optional (start 0) end`
     67
     68As PARSE-UNSIGNED-INTEGER, but assumes SLEB128 encoding and may return
     69a negative first value.
     70
     71[Function][[BR]]
     72'''PUI-STREAM''' `s`
     73
     74Decodes a ULEB128-encoded integer from the VECTOR-INPUT-STREAM S and
     75returns that value.
     76
     77[Function][[BR]]
     78'''PSI-STREAM''' `s`
     79
     80Decodes an SLEB128-encoded integer from the VECTOR-INPUT-STREAM S and
     81returns that value.
     82