Constructor
new BufferControlWriter(initialSizeopt)
Creates a new BufferControlWriter with an initial buffer size
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
initialSize |
number |
<optional> |
1024 |
- Source:
Members
Methods
getBytes() → {Uint8Array}
Gets the current buffer with only the written data
- Source:
Returns:
- Type
- Uint8Array
marshal_(type, fn) → {shaka.msf.BufferControlWriter}
Helper to marshal a message and return this
Parameters:
| Name | Type | Description |
|---|---|---|
type |
shaka.msf.Utils.MessageTypeId | |
fn |
function() |
- Source:
Returns:
marshalClientSetup(msg) → {shaka.msf.BufferControlWriter}
Marshals a Client setup message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.ClientSetup |
- Source:
Returns:
marshalPublishDone(msg) → {shaka.msf.BufferControlWriter}
Marshals a PublishDone message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishDone |
- Source:
Returns:
marshalPublishNamespace(msg) → {shaka.msf.BufferControlWriter}
Marshals an PublishNamespace message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishNamespace |
- Source:
Returns:
marshalPublishNamespaceError(msg) → {shaka.msf.BufferControlWriter}
Marshals an PublishNamespaceError message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishNamespaceError |
- Source:
Returns:
marshalPublishNamespaceOk(msg) → {shaka.msf.BufferControlWriter}
Marshals an PublishNamespaceOk message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishNamespaceOk |
- Source:
Returns:
marshalServerSetup(msg) → {shaka.msf.BufferControlWriter}
Marshals a Server setup message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.ServerSetup |
- Source:
Returns:
marshalSubscribe(msg) → {shaka.msf.BufferControlWriter}
Marshals a Subscribe message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.Subscribe |
- Source:
Returns:
marshalSubscribeError(msg) → {shaka.msf.BufferControlWriter}
Marshals a SubscribeError message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeError |
- Source:
Returns:
marshalSubscribeOk(msg) → {shaka.msf.BufferControlWriter}
Marshals a SubscribeOk message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeOk |
- Source:
Returns:
marshalUnpublishNamespace(msg) → {shaka.msf.BufferControlWriter}
Marshals an UnpublishNamespace message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.UnpublishNamespace |
- Source:
Returns:
marshalUnsubscribe(msg) → {shaka.msf.BufferControlWriter}
Marshals an Unsubscribe message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.Unsubscribe |
- Source:
Returns:
marshalWithLength(messageType, writeContent)
Helper method to marshal a message with proper type and length
Parameters:
| Name | Type | Description |
|---|---|---|
messageType |
shaka.msf.Utils.MessageTypeId | |
writeContent |
function() |
- Source:
reset()
Resets the buffer to start writing from the beginning
- Source:
writeArray_(arraynon-null, writeFn)
Writes an array with a var int length prefix
Parameters:
| Name | Type | Description |
|---|---|---|
array |
Array<T> | |
writeFn |
function(T) |
- Source:
writeBoolAsUint8_(value)
Writes a boolean value as a uint8 to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
value |
boolean |
- Source:
writeKeyValuePair_(pair)
Writes a single key-value pair to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
pair |
shaka.msf.Utils.KeyValuePair |
- Source:
writeKeyValuePairs_(pairs)
Writes an array of key-value pairs to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
pairs |
Array<shaka.msf.Utils.KeyValuePair> | undefined |
- Source:
writeLocation_(location)
Writes a location to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
location |
shaka.msf.Utils.Location |
- Source:
writeString_(str)
Writes a string to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string |
- Source:
writeTuple_(tuple)
Writes a tuple (array of strings) to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
tuple |
Array<string> |
- Source: