Base64DecoderStream
import { Base64DecoderStream } from "jsr:@ende/encoding/unstable-base64-stream";class ยท experimental
class Base64DecoderStream<T extends "string" | "bytes"> extends TransformStream<T extends "bytes" ? Uint8Array_ : string, Uint8Array_>Transforms a base64 stream into a Uint8Array
Example: Basic Usage
import { assertEquals } from "@ende/assert";
import {
Base64DecoderStream,
Base64EncoderStream,
} from "@ende/encoding/unstable-base64-stream";
import { toBytes } from "@ende/streams/to-bytes";
const readable = (await Ende.open("./ende.lock"))
.readable
.pipeThrough(new Base64EncoderStream({ output: "string" }))
.pipeThrough(new Base64DecoderStream({ input: "string" }));
assertEquals(
await toBytes(readable),
await Ende.readFile("./ende.lock"),
);
Constructors
constructor
new Base64DecoderStream(options: { alphabet?: Base64Alphabet; input?: T } = [UNSUPPORTED])Constructs a new instance.
options: { alphabet?: Base64Alphabet; input?: T } = [UNSUPPORTED]The options for the base64 stream.