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§
- vlc
- The
vlc
module provides support for decoding variable-length codes (VLC).
Structs§
- BitReader
Ltr BitReaderLtr
reads bits from most-significant to least-significant from any&[u8]
.- BitReader
Rtl BitReaderRtl
reads bits from least-significant to most-significant from any&[u8]
.- BitStream
Ltr BitStreamLtr
reads bits from most-significant to least-significant from any source that implementsReadBytes
.- BitStream
Rtl BitStreamRtl
reads bits from least-significant to most-significant from any source that implementsReadBytes
.- BufReader
- A
BufReader
reads bytes from a byte buffer. - Media
Source Stream MediaSourceStream
is the main reader type for Symphonia.- Media
Source Stream Options MediaSourceStreamOptions
specifies the buffering behaviour of aMediaSourceStream
.- Monitor
Stream - 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
. - Read
Only Source ReadOnlySource
wraps any source implementingstd::io::Read
in an unseekableMediaSource
.- Scoped
Stream - A
ScopedStream
restricts the number of bytes that may be read to an upper limit.
Traits§
- Finite
BitStream - A
FiniteBitStream
is a bit stream that has a known length in bits. - Finite
Stream - A
FiniteStream
is a stream that has a known length in bytes. - Media
Source MediaSource
is a composite trait ofstd::io::Read
andstd::io::Seek
. A source must implement this trait to be used byMediaSourceStream
.- Monitor
- A
Monitor
provides a common interface to examine the operations observed be aMonitorStream
. - Read
Bits Ltr ReadBitsLtr
reads bits from most-significant to least-significant.- Read
Bits Rtl ReadBitsRtl
reads bits from least-significant to most-significant.- Read
Bytes ReadBytes
provides methods to read bytes and interpret them as little- or big-endian unsigned integers or floating-point values of standard widths.- Seek
Buffered SeekBuffered
provides methods to seek within the buffered portion of a stream.