Liking cljdoc? Tell your friends :D

dk.simongray.podcast.util.bytes.view

Views of files whose bytes come in parts, for the readers of media files and images, on both platforms.

A view holds the parts of a file that are there, each at its offset. A reader asks the view for the ranges that it needs before it reads them. A range that the view doesn't hold throws an exception that holds the ranges, so that the caller can fetch them and read again. A range past the end of the file throws too. The fetching is in util.bytes.ranges.

Views of files whose bytes come in parts, for the readers of media files
and images, on both platforms.

A view holds the parts of a file that are there, each at its offset. A
reader asks the view for the ranges that it needs before it reads them.
A range that the view doesn't hold throws an exception that holds the
ranges, so that the caller can fetch them and read again. A range past
the end of the file throws too. The fetching is in util.bytes.ranges.
raw docstring

addclj/s

(add view offset b total)

The view with the bytes b that begin at offset in the file, in place of the parts that they cover. The total is the size of the file, or nil when the size isn't known.

The `view` with the bytes `b` that begin at `offset` in the file, in
place of the parts that they cover. The `total` is the size of the
file, or nil when the size isn't known.
sourceraw docstring

codeclj/s

(code view p n)

The n bytes of view at p as characters of ISO-8859-1, the form of the four-character codes of ID3 frames and MP4 boxes.

The `n` bytes of `view` at `p` as characters of ISO-8859-1, the form of
the four-character codes of ID3 frames and MP4 boxes.
sourceraw docstring

heldclj/s

(held view)

How many bytes view holds from the start of the file on, without a gap.

How many bytes `view` holds from the start of the file on, without a
gap.
sourceraw docstring

missingclj/s

(missing e)

The ranges that a read of a view missed, as pairs of a start and an end, when e is the exception it threw, or else nil.

The ranges that a read of a view missed, as pairs of a start and an
end, when `e` is the exception it threw, or else nil.
sourceraw docstring

needclj/s

(need view start end)

Nil when view holds the bytes from start to end, end excluded. The end is cut at the end of the file when its size is known.

When the view lacks bytes, it throws an exception that holds the range that it lacks. When start is past the end of the file, it throws the exception of a read past the end.

Nil when `view` holds the bytes from `start` to `end`, end excluded.
The end is cut at the end of the file when its size is known.

When the view lacks bytes, it throws an exception that holds the range
that it lacks. When `start` is past the end of the file, it throws the
exception of a read past the end.
sourceraw docstring

need-allclj/s

(need-all view ranges)

Nil when view holds the bytes of all the ranges, each a pair of a start and an end, end excluded.

When the view lacks bytes, it throws an exception that holds each range that it lacks. So a caller can fetch them all at one time.

Nil when `view` holds the bytes of all the `ranges`, each a pair of a
start and an end, end excluded.

When the view lacks bytes, it throws an exception that holds each range
that it lacks. So a caller can fetch them all at one time.
sourceraw docstring

readingclj/s

(reading f)

What the function f gives, a reading of a view that takes no arguments.

When the view lacks bytes, the result has the ranges that it lacks under :need, as pairs of a start and an end, end excluded. When the reading fails, the result is an empty map, and its report says why. The diagnostic is :file/truncated for a reading past the end of the file, and :file/malformed for any other failure. On the JVM, a reading that overflows the stack is such a failure.

What the function `f` gives, a reading of a view that takes no
arguments.

When the view lacks bytes, the result has the ranges that it lacks
under :need, as pairs of a start and an end, end excluded. When the
reading fails, the result is an empty map, and its report says why. The
diagnostic is :file/truncated for a reading past the end of the file,
and :file/malformed for any other failure. On the JVM, a reading that
overflows the stack is such a failure.
sourceraw docstring

reportclj/s

(report result)

The diagnostics of result, which a reader of a view gave, as maps of an :id, a :level, a :message and details.

The diagnostics of `result`, which a reader of a view gave, as maps of
an :id, a :level, a :message and details.
sourceraw docstring

sliceclj/s

(slice view start end)

The bytes of view from start to end, end excluded, as new bytes, copied from each part that holds some of them.

The bytes of `view` from `start` to `end`, end excluded, as new bytes,
copied from each part that holds some of them.
sourceraw docstring

textclj/s

(text view start end encoding)

The text of the bytes of view from start to end in encoding: :latin1, :utf8, :utf16le or :utf16be.

The text of the bytes of `view` from `start` to `end` in `encoding`:
:latin1, :utf8, :utf16le or :utf16be.
sourceraw docstring

truncated?clj/s

(truncated? e)

Whether e is the exception a read past the end of the file threw.

Whether `e` is the exception a read past the end of the file threw.
sourceraw docstring

u16clj/s

(u16 view p)

The big-endian 16-bit number at p in view.

The big-endian 16-bit number at `p` in `view`.
sourceraw docstring

u16leclj/s

(u16le view p)

The little-endian 16-bit number at p in view.

The little-endian 16-bit number at `p` in `view`.
sourceraw docstring

u24clj/s

(u24 view p)

The big-endian 24-bit number at p in view.

The big-endian 24-bit number at `p` in `view`.
sourceraw docstring

u24leclj/s

(u24le view p)

The little-endian 24-bit number at p in view.

The little-endian 24-bit number at `p` in `view`.
sourceraw docstring

u32clj/s

(u32 view p)

The big-endian 32-bit number at p in view.

The big-endian 32-bit number at `p` in `view`.
sourceraw docstring

u32leclj/s

(u32le view p)

The little-endian 32-bit number at p in view.

The little-endian 32-bit number at `p` in `view`.
sourceraw docstring

u64clj/s

(u64 view p)

The big-endian 64-bit number at p in view, exact up to 2^53 in JavaScript, and up to 2^63 on the JVM. Above that, it's the nearest floating-point number.

The big-endian 64-bit number at `p` in `view`, exact up to 2^53 in
JavaScript, and up to 2^63 on the JVM. Above that, it's the nearest
floating-point number.
sourceraw docstring

u8clj/s

(u8 view p)

The byte at p in view, from 0 to 255.

The byte at `p` in `view`, from 0 to 255.
sourceraw docstring

utf8?clj/s

(utf8? view start end)

Whether the bytes of view from start to end are UTF-8 with one or more characters outside ASCII.

Such bytes are text that a writer meant as UTF-8, also when the writer names another encoding.

Whether the bytes of `view` from `start` to `end` are UTF-8 with one or
more characters outside ASCII.

Such bytes are text that a writer meant as UTF-8, also when the writer
names another encoding.
sourceraw docstring

viewclj/s

(view)
(view total)

A view of a file of total bytes, which is nil when the size isn't known yet, holding no part of it.

A view of a file of `total` bytes, which is nil when the size isn't
known yet, holding no part of it.
sourceraw docstring

wholeclj/s

(whole b)

A view of the file whose bytes are all in b, e.g. a file that the app has read, for a reader to read at once.

A view of the file whose bytes are all in `b`, e.g. a file that the app
has read, for a reader to read at once.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close