Skip to content

Commit

Permalink
BREAKING(io): single-export files (#2975)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua committed Dec 5, 2022
1 parent 259d5a7 commit 8b8950e
Show file tree
Hide file tree
Showing 42 changed files with 2,234 additions and 1,856 deletions.
53 changes: 0 additions & 53 deletions io/_iotest.ts

This file was deleted.

29 changes: 29 additions & 0 deletions io/_test_common.ts
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);
}
}
Loading

0 comments on commit 8b8950e

Please sign in to comment.