summaryrefslogtreecommitdiff
path: root/std/io
diff options
context:
space:
mode:
Diffstat (limited to 'std/io')
-rw-r--r--std/io/bufio.ts12
-rw-r--r--std/io/bufio_test.ts4
2 files changed, 8 insertions, 8 deletions
diff --git a/std/io/bufio.ts b/std/io/bufio.ts
index df3ecb002..da44729b2 100644
--- a/std/io/bufio.ts
+++ b/std/io/bufio.ts
@@ -7,7 +7,7 @@
type Reader = Deno.Reader;
type Writer = Deno.Writer;
type WriterSync = Deno.WriterSync;
-import { copyBytes } from "../bytes/mod.ts";
+import { copy } from "../bytes/mod.ts";
import { assert } from "../_util/assert.ts";
const DEFAULT_BUF_SIZE = 4096;
@@ -150,7 +150,7 @@ export class BufReader implements Reader {
}
// copy as much as we can
- const copied = copyBytes(this.buf.subarray(this.r, this.w), p, 0);
+ const copied = copy(this.buf.subarray(this.r, this.w), p, 0);
this.r += copied;
// this.lastByte = this.buf[this.r - 1];
// this.lastCharSize = -1;
@@ -502,7 +502,7 @@ export class BufWriter extends AbstractBufBase implements Writer {
throw e;
}
} else {
- numBytesWritten = copyBytes(data, this.buf, this.usedBufferBytes);
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
this.usedBufferBytes += numBytesWritten;
await this.flush();
}
@@ -510,7 +510,7 @@ export class BufWriter extends AbstractBufBase implements Writer {
data = data.subarray(numBytesWritten);
}
- numBytesWritten = copyBytes(data, this.buf, this.usedBufferBytes);
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
this.usedBufferBytes += numBytesWritten;
totalBytesWritten += numBytesWritten;
return totalBytesWritten;
@@ -595,7 +595,7 @@ export class BufWriterSync extends AbstractBufBase implements WriterSync {
throw e;
}
} else {
- numBytesWritten = copyBytes(data, this.buf, this.usedBufferBytes);
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
this.usedBufferBytes += numBytesWritten;
this.flush();
}
@@ -603,7 +603,7 @@ export class BufWriterSync extends AbstractBufBase implements WriterSync {
data = data.subarray(numBytesWritten);
}
- numBytesWritten = copyBytes(data, this.buf, this.usedBufferBytes);
+ numBytesWritten = copy(data, this.buf, this.usedBufferBytes);
this.usedBufferBytes += numBytesWritten;
totalBytesWritten += numBytesWritten;
return totalBytesWritten;
diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts
index 804d59e99..3cba3b704 100644
--- a/std/io/bufio_test.ts
+++ b/std/io/bufio_test.ts
@@ -17,7 +17,7 @@ import {
import * as iotest from "./_iotest.ts";
import { StringReader } from "./readers.ts";
import { StringWriter } from "./writers.ts";
-import { copyBytes } from "../bytes/mod.ts";
+import { copy } from "../bytes/mod.ts";
const encoder = new TextEncoder();
@@ -201,7 +201,7 @@ class TestReader implements Deno.Reader {
if (nread === 0) {
return Promise.resolve(null);
}
- copyBytes(this.data, buf as Uint8Array);
+ copy(this.data, buf as Uint8Array);
this.data = this.data.subarray(nread);
return Promise.resolve(nread);
}