Struct caf::CafChunkReader [] [src]

pub struct CafChunkReader<T> where
    T: Read
{ /* fields omitted */ }

Methods

impl<T> CafChunkReader<T> where
    T: Read
[src]

Returns the reader that this Reader wraps

Reads a chunk body into memory and decodes it

Reads a chunk header

impl<T> CafChunkReader<T> where
    T: Read + Seek
[src]

Seeks to the next chunk header in the file

It is meant to be called directly after a chunk header has been read, with the internal reader's position at the start of a chunk's body. It then seeks to the next chunk header.

With this function you can ignore chunks, not reading them, if they have uninteresting content, or if further knowledge on the file is needed before their content becomes interesting.

Panics if the header's chunk size is unspecified per spec (==-1). "Skipping" would make no sense here, as it will put you to the end of the file.

Seeks to the previous chunk header in the file

It is meant to be called with the internal reader's position at the end of a chunk's body. It then seeks to the start of that chunk body.

Panics if the header's chunk size is unspecified per spec (==-1). "Skipping" would make no sense here, as it will put you to the end of the file.

Read chunks from a whitelist to memory

Uses the given CafChunkReader to read all chunks to memory whose types are inside the content_read slice. Stops as soon as all chunk were encountered with types in the required argument list.

As we don't have support for reading chunks with unspecified length, you shouldn't use this function to read audio data to memory. Generally, reading the audio data chunk to memory is a bad idea as it may possibly be very big. Instead, use the nice high level CafPacketReader struct.