Liking cljdoc? Tell your friends :D

clj-commons.byte-streams


bytes=clj

(bytes= a b)

Returns true if the two byte streams are equivalent.

Returns true if the two byte streams are equivalent.
sourceraw docstring

compare-bytesclj

(compare-bytes a b)

Returns a comparison result for two byte streams.

Returns a comparison result for two byte streams.
sourceraw docstring

conversion-costclj

(conversion-cost x dst)

Returns the estimated cost of converting the data x to the destination type dst.

Returns the estimated cost of converting the data `x` to the destination type `dst`.
sourceraw docstring

conversion-pathclj

(conversion-path src dst)
source

conversionsclj

source

convertclj

(convert x dst)
(convert x dst options)

Converts x, if possible, into type dst, which can be either a class or protocol. If no such conversion is possible, an IllegalArgumentException is thrown. If x is a stream, then the src type must be explicitly specified.

options is a map, whose available settings depend on what sort of transform is being performed:

chunk-size - if a stream is being transformed into a sequence of discrete chunks, :chunk-size describes the size of the chunks, which default to 4096 bytes.

encoding - if a string is being encoded or decoded, :encoding describes the charset that is used, which defaults to 'UTF-8'

direct? - if a byte-buffer is being allocated, :direct? describes whether it should be a direct buffer, defaulting to false source-type - overrides input type detection, required to convert a stream

(NB: if you need to convert a stream to a seq, or vice versa, but not the underlying byte type, you want Manifold's stream->seq and ->source instead)

Converts `x`, if possible, into type `dst`, which can be either a class or protocol.  If no such conversion
is possible, an IllegalArgumentException is thrown.  If `x` is a stream, then the `src` type must be explicitly
specified.

`options` is a map, whose available settings depend on what sort of transform is being performed:

`chunk-size`  - if a stream is being transformed into a sequence of discrete chunks, `:chunk-size` describes the
                size of the chunks, which default to 4096 bytes.

`encoding`    - if a string is being encoded or decoded, `:encoding` describes the charset that is used, which
                defaults to 'UTF-8'

`direct?`     - if a byte-buffer is being allocated, `:direct?` describes whether it should be a direct buffer,
                defaulting to false
`source-type` - overrides input type detection, required to convert a stream

(NB: if you need to convert a stream to a seq, or vice versa, but not the underlying byte type, you want
Manifold's `stream->seq` and `->source` instead)
sourceraw docstring

def-conversioncljmacro

(def-conversion [src dst :as conversion] params & body)

Defines a conversion from one type to another.

Defines a conversion from one type to another.
sourceraw docstring

def-transfercljmacro

(def-transfer [src dst] params & body)

Defines a byte transfer from one type to another.

Defines a byte transfer from one type to another.
sourceraw docstring

dev-nullclj

Web-scale.

Web-scale.
sourceraw docstring

inverse-conversionsclj

source

optimized-transfer?clj

(optimized-transfer? type-descriptor sink-type)

Returns true if an optimized transfer function exists for the given source and sink objects.

Returns true if an optimized transfer function exists for the given source and sink objects.
sourceraw docstring

possible-conversionsclj

(possible-conversions src)

Returns a list of all possible conversion targets from value.

Returns a list of all possible conversion targets from value.
sourceraw docstring

(print-bytes bytes)

Prints out the bytes in both hex and ASCII representations, 16 bytes per line.

Prints out the bytes in both hex and ASCII representations, 16 bytes per line.
sourceraw docstring

seq-ofclj

(seq-of x)
source

src->dst->transferclj

source

stream-ofclj

(stream-of x)
source

to-byte-arrayclj

(to-byte-array x)
(to-byte-array x options)

Converts the object to a byte-array.

Converts the object to a byte-array.
sourceraw docstring

to-byte-arraysclj

(to-byte-arrays x)
(to-byte-arrays x options)

Converts the object to a byte-array.

Converts the object to a byte-array.
sourceraw docstring

to-byte-bufferclj

(to-byte-buffer x)
(to-byte-buffer x options)

Converts the object to a java.nio.ByteBuffer.

Converts the object to a `java.nio.ByteBuffer`.
sourceraw docstring

to-byte-buffersclj

(to-byte-buffers x)
(to-byte-buffers x options)

Converts the object to a sequence of java.nio.ByteBuffer.

Converts the object to a sequence of `java.nio.ByteBuffer`.
sourceraw docstring

to-byte-sinkclj

(to-byte-sink x)
(to-byte-sink x options)

Converts the object to something that satisfies ByteSink.

Converts the object to something that satisfies `ByteSink`.
sourceraw docstring

to-byte-sourceclj

(to-byte-source x)
(to-byte-source x options)

Converts the object to something that satisfies ByteSource.

Converts the object to something that satisfies `ByteSource`.
sourceraw docstring

to-char-sequenceclj

(to-char-sequence x)
(to-char-sequence x options)

Converts to the object to a java.lang.CharSequence.

Converts to the object to a `java.lang.CharSequence`.
sourceraw docstring

to-data-input-streamclj

(to-data-input-stream x)
(to-data-input-stream x options)
source

to-input-streamclj

(to-input-stream x)
(to-input-stream x options)

Converts the object to a java.io.InputStream.

Converts the object to a `java.io.InputStream`.
sourceraw docstring

to-line-seqclj

(to-line-seq x)
(to-line-seq x options)

Converts the object to a lazy sequence of newline-delimited strings.

Converts the object to a lazy sequence of newline-delimited strings.
sourceraw docstring

to-output-streamclj

(to-output-stream x)
(to-output-stream x options)

Converts the object to a java.io.OutputStream.

Converts the object to a `java.io.OutputStream`.
sourceraw docstring

to-readable-channelclj

(to-readable-channel x)
(to-readable-channel x options)

Converts the object to a java.nio.ReadableByteChannel

Converts the object to a `java.nio.ReadableByteChannel`
sourceraw docstring

to-readerclj

(to-reader x)
(to-reader x options)

Converts the object to a java.io.Reader.

Converts the object to a java.io.Reader.
sourceraw docstring

to-stringclj

(to-string x)
(to-string x options)

Converts the object to a string. Will consume all input it can. Consider using to-reader, to-line-seq, or to-char-sequence for lazy / partial input consumption.

Converts the object to a string.
Will consume all input it can.
Consider using to-reader, to-line-seq, or to-char-sequence for lazy / partial input consumption.
sourceraw docstring

transferclj

(transfer source sink)
(transfer source sink options)
(transfer source source-type sink options)

Transfers, if possible, all bytes from source into sink. If this cannot be accomplished, an IllegalArgumentException is thrown.

options is a map whose available settings depends on the source and sink types:

chunk-size - if a stream is being transformed into a sequence of discrete chunks, :chunk-size describes the size of the chunks, which default to 4096 bytes.

encoding - if a string is being encoded or decoded, :encoding describes the charset that is used, which defaults to 'UTF-8'

append? - if a file is being written to, :append? determines whether the bytes will overwrite the existing content or be appended to the end of the file. This defaults to true.

close? - whether the sink and source should be closed once the transfer is done, defaults to true.

Transfers, if possible, all bytes from `source` into `sink`.  If this cannot be accomplished, an IllegalArgumentException is
thrown.

`options` is a map whose available settings depends on the source and sink types:

`chunk-size` - if a stream is being transformed into a sequence of discrete chunks, `:chunk-size` describes the
               size of the chunks, which default to 4096 bytes.

`encoding`   - if a string is being encoded or decoded, `:encoding` describes the charset that is used, which
               defaults to 'UTF-8'

`append?`    - if a file is being written to, `:append?` determines whether the bytes will overwrite the existing content
               or be appended to the end of the file.  This defaults to true.

`close?`     - whether the sink and source should be closed once the transfer is done, defaults to true.
sourceraw docstring

type-descriptorclj

(type-descriptor x)

Returns a descriptor of the type of the given instance.

Returns a descriptor of the type of the given instance.
sourceraw docstring

vector-ofclj

(vector-of x)
source

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

× close