Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
method BytesList.prototype.getChunkIndex
Deprecated
Deprecated

Use a plain array of Uint8Arrays instead. Finding the index of a chunk in the array can be done using Array#findIndex with a counter for the number of bytes already encountered from past chunks' Uint8Array#byteLength.

import { BytesList } from "https://deno.land/std@0.202.0/bytes/bytes_list.ts";

Find chunk index in which pos locates by binary-search returns -1 if out of range

Parameters

pos: number

Returns

number