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:
marshalGoaway(msg) → {shaka.msf.BufferControlWriter}
Marshals a Goaway message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.Goaway |
- Source:
Returns:
marshalMaxRequestId(msg) → {shaka.msf.BufferControlWriter}
Marshals a MaxRequestId message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.MaxRequestId |
- Source:
Returns:
marshalPublish(msg) → {shaka.msf.BufferControlWriter}
Marshals a Publish message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.Publish |
- 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:
marshalPublishError(msg) → {shaka.msf.BufferControlWriter}
Marshals a PublishError message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishError |
- 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:
marshalPublishNamespaceCancel(msg) → {shaka.msf.BufferControlWriter}
Marshals an PublishNamespaceCancel message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishNamespaceCancel |
- Source:
Returns:
marshalPublishNamespaceDone(msg) → {shaka.msf.BufferControlWriter}
Marshals an PublishNamespaceDone message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishNamespaceDone |
- 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:
marshalPublishOk(msg) → {shaka.msf.BufferControlWriter}
Marshals a PublishOk message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.PublishOk |
- Source:
Returns:
marshalRequestsBlocked(msg) → {shaka.msf.BufferControlWriter}
Marshals a RequestsBlocked message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.RequestsBlocked |
- 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:
marshalSubscribeNamespace(msg) → {shaka.msf.BufferControlWriter}
Marshals an SubscribeNamespace message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeNamespace |
- Source:
Returns:
marshalSubscribeNamespaceError(msg) → {shaka.msf.BufferControlWriter}
Marshals an SubscribeNamespaceError message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeNamespaceError |
- Source:
Returns:
marshalSubscribeNamespaceOk(msg) → {shaka.msf.BufferControlWriter}
Marshals an SubscribeNamespaceOk message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeNamespaceOk |
- 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:
marshalSubscribeUpdate(msg) → {shaka.msf.BufferControlWriter}
Marshals a SubscribeUpdate message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.SubscribeUpdate |
- 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:
marshalUnsubscribeNamespace(msg) → {shaka.msf.BufferControlWriter}
Marshals an UnsubscribeNamespace message to the buffer
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
shaka.msf.Utils.UnsubscribeNamespace |
- 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: