Module symphonia_core::io
source · Expand description
The io
module implements composable bit- and byte-level I/O.
The following nomenclature is used to denote where the data being read is sourced from:
- A
Stream
consumes any source implementingReadBytes
one byte at a time. - A
Reader
consumes a&[u8]
.
The sole exception to this rule is MediaSourceStream
which consumes sources implementing
MediaSource
(aka. std::io::Read
).
All Reader
s and Stream
s operating on bytes of data at a time implement the ReadBytes
trait. Likewise, all Reader
s and Stream
s operating on bits of data at a time implement
either the ReadBitsLtr
or ReadBitsRtl
traits depending on the order in which they
consume bits.
Modules§
- The
vlc
module provides support for decoding variable-length codes (VLC).
Structs§
BitReaderLtr
reads bits from most-significant to least-significant from any&[u8]
.BitReaderRtl
reads bits from least-significant to most-significant from any&[u8]
.BitStreamLtr
reads bits from most-significant to least-significant from any source that implementsReadBytes
.BitStreamRtl
reads bits from least-significant to most-significant from any source that implementsReadBytes
.- A
BufReader
reads bytes from a byte buffer. MediaSourceStream
is the main reader type for Symphonia.MediaSourceStreamOptions
specifies the buffering behaviour of aMediaSourceStream
.- A
MonitorStream
is a passive stream that observes all operations performed on the inner stream and forwards an immutable reference of the result to aMonitor
. - A
ScopedStream
restricts the number of bytes that may be read to an upper limit.
Traits§
- A
FiniteBitStream
is a bit stream that has a known length in bits. - A
FiniteStream
is a stream that has a known length in bytes. MediaSource
is a composite trait ofstd::io::Read
andstd::io::Seek
. A source must implement this trait to be used byMediaSourceStream
.- A
Monitor
provides a common interface to examine the operations observed be aMonitorStream
. ReadBitsLtr
reads bits from most-significant to least-significant.ReadBitsRtl
reads bits from least-significant to most-significant.ReadBytes
provides methods to read bytes and interpret them as little- or big-endian unsigned integers or floating-point values of standard widths.SeekBuffered
provides methods to seek within the buffered portion of a stream.