@cere-ddc-sdk/ddc / PieceResponse
The PieceResponse
class represents a response for a piece content.
• get
cid(): string
The content identifier (CID) of the piece.
string
• get
hash(): Uint8Array
The hash of the piece response content.
Uint8Array
• get
range(): undefined
| GetFileRequest_Request_Range
The range of the piece response.
undefined
| GetFileRequest_Request_Range
▸ arrayBuffer(): Promise
<ArrayBuffer
>
Converts the body stream of the piece to an ArrayBuffer
.
Promise
<ArrayBuffer
>
The piece content as an ArrayBuffer
.
▸ json(): Promise
<unknown
>
Converts the body stream of the piece to a JSON object.
Promise
<unknown
>
The piece content as a JSON object.
▸ text(): Promise
<string
>
Converts the body stream of the piece to a string.
Promise
<string
>
The piece content as a string.
• Readonly
body: ContentStream
The content of the piece response as a stream.