* Creates a CborByteEncoderStream instance from an iterable of * Uint8Array chunks. * * @example Usage * ```ts * import { assert, assertEquals } from "@std/assert"; * import { concat } from "@std/bytes"; * import { * CborByteDecodedStream, * CborByteEnc
(
asyncIterable: AsyncIterable<Uint8Array> | Iterable<Uint8Array>,
)
| 100 | * @returns A {@link CborByteEncoderStream} instance of the encoded data. |
| 101 | */ |
| 102 | static from( |
| 103 | asyncIterable: AsyncIterable<Uint8Array> | Iterable<Uint8Array>, |
| 104 | ): CborByteEncoderStream { |
| 105 | const encoder = new CborByteEncoderStream(); |
| 106 | ReadableStream.from(asyncIterable).pipeTo(encoder.writable); |
| 107 | return encoder; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * The {@link ReadableStream<Uint8Array>} associated with the instance, which |