• Returns a converter for TypedArray objects.

    Note that a TypedArray is a view into an underlying ArrayBuffer. This view allows to cover a subset of the ArrayBuffer, for example when using TypedArray.prototype.subarray(). For views which are subsets, a roundtrip from TypedArray to ArrayBuffer and back will yield a TypedArray that is not a subset anymore.

    Example:

    const arr = new Uint8Array([42]);
    const conv = ccfapp.typedArray(Uint8Array);
    const buffer = conv.encode(arr); // ArrayBuffer of size arr.byteLength
    const arr2 = conv.decode(buffer); // Uint8Array

    Type Parameters

    • T extends ArrayBufferView

    Parameters

    Returns DataConverter<T>