Next: , Previous: , Up: bytevectors 8   [Index]


27.2.4 Constructors

Function: bytevector-s8-append bv0 bv ...
Function: bytevector-u8-append bv0 bv ...

Return a newly allocated bytevector whose bytes form the concatenation of the given bytevectors.

Function: bytevector-u8-concatenate bvs-list
Function: bytevector-s8-concatenate bvs-list

Append the elements of bvs-list together into a single bytevector. Guaranteed to return a freshly allocated bytevector.

Function: %bytevector-s8-concatenate-reverse bvs-list final-bv nbytes
Function: %bytevector-u8-concatenate-reverse bvs-list final-bv nbytes
Macro: bytevector-s8-concatenate-reverse bvs-list
Macro: bytevector-u8-concatenate-reverse bvs-list
Macro: bytevector-s8-concatenate-reverse bvs-list final-bv
Macro: bytevector-u8-concatenate-reverse bvs-list final-bv
Macro: bytevector-s8-concatenate-reverse bvs-list final-bv nbytes
Macro: bytevector-u8-concatenate-reverse bvs-list final-bv nbytes

Reverse bvs-list then concatenate the elements, which must be bytevectors. The first nbytes bytes in final-bv are consed onto the beginning of bvs-list before performing the reversal and concatenation operations.

final-bv defaults to the empty bytevector and nbytes defaults to the length of final-bv.

This procedure is useful in the construction of procedures that accumulate byte data into lists of byte buffers, and wish to convert the accumulated data into a single bytevector when done.

Function: bytevector-s8-tabulate integer->byte len
Function: bytevector-u8-tabulate integer->byte len

Construct a bytevector of size len by applying integer->byte to each index in the range [0, len) to produce the corresponding byte element. The order in which integer->byte is applied to the indices is not specified.