net.transform.split

A generic splitting transducer for collections of ByteBuf instances To help the splitting process, and to allow other types of splitting to occur, two protocols are provided.

bytes-needed

(bytes-needed parser kept buf)

Figure out how many bytes need to be read to finish this split.

ContentSplitter

protocol

members

offer

(offer this buf)

Augment a splitter instance with a new buffer, yielding a vector of the updated splitter and a new buffer if one was found.

HeaderParser

protocol

members

header-length

(header-length this buf)

Yield length of header needed to compute the length of the split, if possible.

payload-length

(payload-length this mark kept buf)

Yield the length of the full split payload, this assumes header-length was called and returned.

Initializer

protocol

members

initialize!

(initialize! this)

Initialize a splitter, called everytime a new buffer is output to reset internal state.

parse-split

(parse-split stored buf)

With a new buffer, augment a splitter by consuming all data from the buffer. Yields a vector of the augmented splitter and a sequence of new buffers to output, if any.

raw-split

(raw-split splitter)

A transducer that yields collections of ByteBuf instances, from a collection of ByteBuf instances, splitting with the help of a ContentSplitter implementation.

split

(split splitter)

Facility function to create a splitter which yields a single collection of ByteBuf instances.