-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING(io): single-export files (#2975)
- Loading branch information
Showing
42 changed files
with
2,234 additions
and
1,856 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. | ||
|
||
import type { Reader } from "./types.d.ts"; | ||
|
||
export const MIN_READ_BUFFER_SIZE = 16; | ||
export const bufsizes: number[] = [ | ||
0, | ||
MIN_READ_BUFFER_SIZE, | ||
23, | ||
32, | ||
46, | ||
64, | ||
93, | ||
128, | ||
1024, | ||
4096, | ||
]; | ||
|
||
export class BinaryReader implements Reader { | ||
index = 0; | ||
|
||
constructor(private bytes: Uint8Array = new Uint8Array(0)) {} | ||
|
||
read(p: Uint8Array): Promise<number | null> { | ||
p.set(this.bytes.subarray(this.index, p.byteLength)); | ||
this.index += p.byteLength; | ||
return Promise.resolve(p.byteLength); | ||
} | ||
} |
Oops, something went wrong.