PayloadAssembler class

Assembles payloads for streaming library.

Constructors

PayloadAssembler(StreamManager, IAssemblerParams)

Initializes a new instance of the PayloadAssembler class.

Properties

contentLength
end
id
payloadType

Methods

close()

Closes the assembler.

getPayloadStream()

Retrieves the assembler's payload as a stream.

onReceive(IHeader, SubscribableStream, number)

The action the assembler executes when new bytes are received on the incoming stream.

Constructor Details

PayloadAssembler(StreamManager, IAssemblerParams)

Initializes a new instance of the PayloadAssembler class.

new PayloadAssembler(streamManager: StreamManager, params: IAssemblerParams)

Parameters

streamManager
StreamManager

The StreamManager managing the stream being assembled.

params
IAssemblerParams

Parameters for a streaming assembler.

Property Details

contentLength

contentLength: number

Property Value

number

end

end: boolean

Property Value

boolean

id

id: string

Property Value

string

payloadType

payloadType: string | PayloadTypes

Property Value

string | PayloadTypes

Method Details

close()

Closes the assembler.

function close()

getPayloadStream()

Retrieves the assembler's payload as a stream.

function getPayloadStream(): SubscribableStream

Returns

A SubscribableStream of the assembler's payload.

onReceive(IHeader, SubscribableStream, number)

The action the assembler executes when new bytes are received on the incoming stream.

function onReceive(header: IHeader, stream: SubscribableStream, _contentLength: number)

Parameters

header
IHeader

The stream's Header.

stream
SubscribableStream

The incoming stream being assembled.

_contentLength

number

The length of the stream, if finite.