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 implementing ReadBytes 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 Readers and Streams operating on bytes of data at a time implement the ReadBytes trait. Likewise, all Readers and Streams 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 implements ReadBytes.
  • BitStreamRtl reads bits from least-significant to most-significant from any source that implements ReadBytes.
  • A BufReader reads bytes from a byte buffer.
  • MediaSourceStream is the main reader type for Symphonia.
  • MediaSourceStreamOptions specifies the buffering behaviour of a MediaSourceStream.
  • A MonitorStream is a passive stream that observes all operations performed on the inner stream and forwards an immutable reference of the result to a Monitor.
  • ReadOnlySource wraps any source implementing std::io::Read in an unseekable MediaSource.
  • 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 of std::io::Read and std::io::Seek. A source must implement this trait to be used by MediaSourceStream.
  • A Monitor provides a common interface to examine the operations observed be a MonitorStream.
  • 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.