다음을 통해 공유


ContentStream class

디코딩할 콘텐츠를 포함하는 고정 또는 무한 길이의 스트림입니다.

생성자

ContentStream(string, PayloadAssembler)

ContentStream 클래스의 새 인스턴스를 초기화합니다.

속성

contentType

ContentStream포함된 개체 형식의 이름을 가져옵니다.

id
length

ContentStream길이를 가져옵니다.

메서드

cancel()

어셈블러를 닫습니다.

getStream()

ContentStream포함된 데이터를 가져옵니다.

readAsJson<T>()

SubscribableStream 콘텐츠를 형식화된 JSON 개체로 가져옵니다.

readAsString()

SubscribableStream 콘텐츠를 문자열로 가져옵니다.

생성자 세부 정보

ContentStream(string, PayloadAssembler)

ContentStream 클래스의 새 인스턴스를 초기화합니다.

new ContentStream(id: string, assembler: PayloadAssembler)

매개 변수

id

string

이 인스턴스에 할당된 ID입니다.

assembler
PayloadAssembler

이 인스턴스에 할당된 PayloadAssembler.

속성 세부 정보

contentType

ContentStream포함된 개체 형식의 이름을 가져옵니다.

string | PayloadTypes contentType

속성 값

string | PayloadTypes

ContentStreamPayloadType.

id

id: string

속성 값

string

length

ContentStream길이를 가져옵니다.

number length

속성 값

number

ContentStream길이를 나타내는 숫자입니다.

메서드 세부 정보

cancel()

어셈블러를 닫습니다.

function cancel()

getStream()

ContentStream포함된 데이터를 가져옵니다.

function getStream(): SubscribableStream

반환

ContentStream의SubscribableStream.

readAsJson<T>()

SubscribableStream 콘텐츠를 형식화된 JSON 개체로 가져옵니다.

function readAsJson<T>(): Promise<T>

반환

Promise<T>

SubscribableStream 콘텐츠가 있는 형식화된 개체 Promise입니다.

readAsString()

SubscribableStream 콘텐츠를 문자열로 가져옵니다.

function readAsString(): Promise<string>

반환

Promise<string>

SubscribableStream 콘텐츠가 포함된 문자열 Promise입니다.