ContentStream class
固定或無限長度的數據流,包含要譯碼的內容。
建構函式
| Content |
初始化 contentStream 類別 |
屬性
| content |
取得這個 ContentStream中包含的物件型別名稱。 |
| id | |
| length | 取得這個 ContentStream的長度。 |
方法
| cancel() | 關閉組合器。 |
| get |
取得這個 ContentStream中包含的數據。 |
| read |
取得 SubscribableStream 內容做為具類型的 JSON 物件。 |
| read |
取得 SubscribableStream 內容做為字串。 |
建構函式詳細資料
ContentStream(string, PayloadAssembler)
初始化 contentStream 類別
new ContentStream(id: string, assembler: PayloadAssembler)
參數
- id
-
string
指派給這個實例的標識碼。
- assembler
- PayloadAssembler
指派給這個實例 PayloadAssembler。
屬性詳細資料
contentType
取得這個 ContentStream中包含的物件型別名稱。
string | PayloadTypes contentType
屬性值
string | PayloadTypes
這個 ContentStream的 PayloadType。
id
id: string
屬性值
string
length
方法詳細資料
cancel()
關閉組合器。
function cancel()
getStream()
readAsJson<T>()
取得 SubscribableStream 內容做為具類型的 JSON 物件。
function readAsJson<T>(): Promise<T>
傳回
Promise<T>
具有 SubscribableStream 內容的具類型物件 Promise。
readAsString()
取得 SubscribableStream 內容做為字串。
function readAsString(): Promise<string>
傳回
Promise<string>
具有 SubscribableStream 內容的字串 Promise。