On this page:
3.1 Sizes and Counts
with-size/ p
with-count/ p
3.2 Blocks of Unlimited Packed Size
bytes/ p
string/ p
3.3 Derived Types
symbol/ p

3 Chunk Packings

    3.1 Sizes and Counts

    3.2 Blocks of Unlimited Packed Size

    3.3 Derived Types

 (require (planet murphy/packed-io/chunk))
This module provides packings of variable size chunks of data.

3.1 Sizes and Counts

(with-size/p size    
  packing    
  #:adjustment adjustment)  packing?
  size : (or/c 1 2 4 8)
  packing : packing?
  adjustment : 0
Limits the size of input that can be consumed by packing, adding a size bytes long unsigned integer to the packed representation that determines the size of the following data.

The given adjustment is added to the size of the data packed by packing while packing and subtracted while unpacking.

(with-count/p size    
  packing    
  #:adjustment adjustment)  packing?
  size : (or/c 1 2 4 8)
  packing : packing?
  adjustment : 0
Produces a packing for a vector of elements packed using packing. The length of the vector is stored as a size bytes long unsigned integer.

The given adjustment is added to the length of the packed vector packing and subtracted while unpacking.

3.2 Blocks of Unlimited Packed Size

bytes/p : packing?
Reads all remaining input into a byte string when unpacking and writes a plain byte string to the output when packing.

Combine this with with-size/p to pack a byte string together with length information.

string/p : packing?
Reads all remaining input into a string when unpacking and writes a plain string to the output when packing.

Combine this with with-size/p to pack a string together with length information.

3.3 Derived Types

symbol/p : packing?
Reads all remaining input into a string and converts it into a symbol when unpacking and writes a plain string representation of a symbol to the output when packing.

Combine this with with-size/p to pack a symbol together with length information.