(bytes= a b)
Returns true if the two byte streams are equivalent.
Returns true if the two byte streams are equivalent.
(compare-bytes a b)
Returns a comparison result for two byte streams.
Returns a comparison result for two byte streams.
(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`.
(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)
(def-conversion [src dst :as conversion] params & body)
Defines a conversion from one type to another.
Defines a conversion from one type to another.
(def-transfer [src dst] params & body)
Defines a byte transfer from one type to another.
Defines a byte transfer from one type to another.
(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.
(possible-conversions src)
Returns a list of all possible conversion targets from value.
Returns a list of all possible conversion targets from value.
(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.
(to-byte-array x)
(to-byte-array x options)
Converts the object to a byte-array.
Converts the object to a byte-array.
(to-byte-arrays x)
(to-byte-arrays x options)
Converts the object to a byte-array.
Converts the object to a byte-array.
(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`.
(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`.
(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`.
(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`.
(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`.
(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`.
(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.
(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`.
(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`
(to-reader x)
(to-reader x options)
Converts the object to a java.io.Reader.
Converts the object to a java.io.Reader.
(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.
(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.
(type-descriptor x)
Returns a descriptor of the type of the given instance.
Returns a descriptor of the type of the given instance.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close