• Cuts a stream of already-serialized messages into comms-sized chunks, never splitting one. The single place a chunk boundary is decided and the single place an oversized message is reported.

    messages is pulled lazily and each messageBuffer is copied into the chunk before the next one is pulled, so a caller may yield views over a buffer it reuses between messages.

    Parameters

    Returns Uint8Array[]