gloss.io

contiguous

(contiguous buf-seq)

Takes a sequence of ByteBuffers and returns a single contiguous ByteBuffer.

decode

(decode frame bytes)(decode frame bytes no-remainder?)

Turns bytes into a single frame value. If there are too few or too many bytes for the frame, an exception is thrown.

decode-all

(decode-all frame bytes)

Turns bytes into a sequence of frame values. If there are bytes left over at the end of the sequence, an exception is thrown.

decode-channel

decode-channel-headers

decode-stream

(decode-stream src frame)

Given a stream that emits bytes, returns a channel that emits decoded frames whenever there are sufficient bytes.

decode-stream-headers

(decode-stream-headers src & frames)

Given a channel that emits bytes, returns a channel that will emit one decoded frame for each frame passed into the function. After those frames have been decoded, the channel will simply emit any bytes that are passed into the source channel.

encode

(encode frame val)

Turns a frame value into a sequence of ByteBuffers.

encode-all

(encode-all frame vals)

Turns a sequence of frame values into a sequence of ByteBuffers.

encode-to-buffer

(encode-to-buffer frame buf vals)

Encodes a sequence of values, and writes them to a ByteBuffer.

encode-to-stream

(encode-to-stream frame output-stream vals)

Encodes a sequence of values, and writes them to an OutputStream.

lazy-decode-all

(lazy-decode-all frame bytes)

Turns bytes into a lazy sequence of frame values. If there are bytes left over at the end of the sequence, an exception is thrown.

to-buf-seq

(to-buf-seq x)

Converts the value to a sequence of ByteBuffers.

to-byte-buffer

(to-byte-buffer x)

Converts the value to a Bytebuffer.