Skip to content

BufferList Class Reference

Thijs Triemstra edited this page Sep 28, 2015 · 8 revisions

An AV.BufferList is, as its name implies, a list of AV.Buffer objects. It manages the current total length of the list and is used by the Stream class internally. When using Aurora, you won't deal with AV.BufferLists directly very often.

Constructor

Properties

Methods

Constructor

new AV.BufferList()

Creates a new AV.BufferList with no data.

Properties

AV.BufferList#availableBytes

The current total length of the buffer list.

AV.BufferList#availableBuffers

The current number of buffers in the list.

AV.BufferList#numBuffers

The total number of buffers in the list.

AV.BufferList#first

The current first buffer in the list, or the head.

AV.BufferList#first

The last buffer in the list, or the tail.

Methods

AV.BufferList#copy()

Returns a copy of the buffer list with a shallow copy of the buffers. Modifying the buffers in the cloned AV.BufferList will modify the buffers in the original BufferList.

AV.BufferList#append(buffer)

Adds a buffer to the end of the buffer list. Updates availableBytes, availableBuffers, and numBuffers.

AV.BufferList#advance()

Advances the buffer list by one buffer, shifting off list.first and replacing it with the next buffer in the list. Returns a boolean indicating whether or not advancing was successful, e.g. if there was a buffer to advance to.

AV.BufferList#rewind()

Rewinds the buffer list by one buffer, replacing list.first with the previous buffer in the list. Returns a boolean indicating whether or not rewinding was successful, e.g. if there was a buffer to rewind to.

AV.BufferList#reset()

Rewinds the buffer list to the beginning.