Liking cljdoc? Tell your friends :D

systems.thoughtfull.transductio


decoderclj

(decoder open decode done?)
(decoder open decode done? close)

Returns a function that takes a source and returns a reducible that, opens the source, repeatedly decodes data from it, and closes it when it is done.

open takes the source and returns a stateful, mutable object that will be given to decode and eventually to close.

decode is given the opened source and must return either a decoded value or a sentinel indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

close must not be nil. If close is not given, then it defaults to java.lang.AutoCloseable/.close.

When the reduction completes whether normally, early (someone returns a reduced), or because of an exception, then close is called.

See stream-decoder and reader-decoder.

Returns a function that takes a source and returns a reducible that, opens the source, repeatedly
decodes data from it, and closes it when it is done.

open takes the source and returns a stateful, mutable object that will be given to decode and
eventually to close.

decode is given the opened source and must return either a decoded value or a sentinel
indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

close must not be nil.  If close is not given, then it defaults to
java.lang.AutoCloseable/.close.

When the reduction completes whether normally, early (someone returns a reduced), or because of
an exception, then close is called.

See stream-decoder and reader-decoder.
sourceraw docstring

encoderclj

(encoder open encode!)
(encoder open encode! close)

Returns a function that takes either a sink and a source, reducing the source into the sink, or a sink, a transducer, and a source, transducing the source into the sink through the transducer. This is an analog of into but for a mutable sink.

open takes the sink and returns a stateful, mutable object that will be given to encode! and eventually to close.

encode! is given the opened sink and a value and must mutate the sink with the value. The return value from encode! is ignored.

close must not be nil. If close is not given, then it defaults to java.lang.AutoCloseable/.close.

When the reduction/transduction completes whether normally, early (someone returns a reduced), or because of an exception, then close is called.

See stream-encoder and writer-encoder

Returns a function that takes either a sink and a source, reducing the source into the sink, or a
sink, a transducer, and a source, transducing the source into the sink through the transducer.
This is an analog of into but for a mutable sink.

open takes the sink and returns a stateful, mutable object that will be given to encode! and
eventually to close.

encode! is given the opened sink and a value and must mutate the sink with the value.  The
return value from encode! is ignored.

close must not be nil.  If close is not given, then it defaults to
java.lang.AutoCloseable/.close.

When the reduction/transduction completes whether normally, early (someone returns a reduced),
or because of an exception, then close is called.

See stream-encoder and writer-encoder
sourceraw docstring

reader-decoderclj

(reader-decoder decode done?)
(reader-decoder decode done? encoding)

Returns a function that takes a source and returns a reducible that, opens the source as a java.io.Reader, repeatedly decodes data from it, and closes it when it is done.

The decoder opens the source with clojure.java.io/reader and opts.

decode is given the opened source and must return either a decoded value or a sentinel indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

The decoder closes source with java.lang.AutoCloseable/.close.

See decoder and stream-decoder.

Returns a function that takes a source and returns a reducible that, opens the source as a
java.io.Reader, repeatedly decodes data from it, and closes it when it is done.

The decoder opens the source with clojure.java.io/reader and opts.

decode is given the opened source and must return either a decoded value or a sentinel
indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

The decoder closes source with java.lang.AutoCloseable/.close.

See decoder and stream-decoder.
sourceraw docstring

stream-decoderclj

(stream-decoder decode done?)

Returns a function that takes a source and returns a reducible that, opens the source as a java.io.InputStream, repeatedly decodes data from it, and closes it when it is done.

The decoder opens the source with clojure.java.io/input-stream and opts.

decode is given the opened source and must return either a decoded value or a sentinel indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

The decoder closes source with java.lang.AutoCloseable/.close.

See decoder and reader-decoder.

Returns a function that takes a source and returns a reducible that, opens the source as a
java.io.InputStream, repeatedly decodes data from it, and closes it when it is done.

The decoder opens the source with clojure.java.io/input-stream and opts.

decode is given the opened source and must return either a decoded value or a sentinel
indicating there is no more data.

done? is given each decoded value and if it returns truthy, then the decoding ends.

The decoder closes source with java.lang.AutoCloseable/.close.

See decoder and reader-decoder.
sourceraw docstring

stream-encoderclj

(stream-encoder)
(stream-encoder append)

Returns a function that takes either a sink and a source, reducing the source into the sink, or a sink, a transducer, and a source, transducing the source into the sink through the transducer. This is an analog of into but for a java.io.OutputStream.

The encoder opens the sink with clojure.java.io/output-stream and opts.

The source (or the transducer applied to the source) must return byte arrays which are written to the output stream.

When the reduction/transduction completes whether normally, early (someone returns a reduced), or because of an exception, then the stream is closed.

See encoder and writer-encoder

Returns a function that takes either a sink and a source, reducing the source into the sink, or a
sink, a transducer, and a source, transducing the source into the sink through the transducer.
This is an analog of into but for a java.io.OutputStream.

The encoder opens the sink with clojure.java.io/output-stream and opts.

The source (or the transducer applied to the source) must return byte arrays which are written
to the output stream.

When the reduction/transduction completes whether normally, early (someone returns a reduced),
or because of an exception, then the stream is closed.

See encoder and writer-encoder
sourceraw docstring

writer-encoderclj

(writer-encoder)
(writer-encoder append)

Returns a function that takes either a sink and a source, reducing the source into the sink, or a sink, a transducer, and a source, transducing the source into the sink through the transducer. This is an analog of into but for a java.io.Writer.

The encoder opens the sink with clojure.java.io/writer and opts.

The source (or the transducer applied to the source) must return Strings which are written to the output stream.

When the reduction/transduction completes whether normally, early (someone returns a reduced), or because of an exception, then the stream is closed.

See encoder and stream-encoder

Returns a function that takes either a sink and a source, reducing the source into the sink, or a
sink, a transducer, and a source, transducing the source into the sink through the transducer.
This is an analog of into but for a java.io.Writer.

The encoder opens the sink with clojure.java.io/writer and opts.

The source (or the transducer applied to the source) must return Strings which are written to
the output stream.

When the reduction/transduction completes whether normally, early (someone returns a reduced),
or because of an exception, then the stream is closed.

See encoder and stream-encoder
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close