diff options
author | Yosi Pramajaya <yosi.pramajaya@gmail.com> | 2020-12-06 21:51:13 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 09:51:13 -0500 |
commit | 0b37a79060e48c1fe6936c6e642044e9b20b9bb5 (patch) | |
tree | c8f759f1ad4f6f16bdf2193bac66eb92da9b4bd5 /std/io/bufio.ts | |
parent | c10280214e5e15fb31b83368082916b9f25470f9 (diff) |
BREAKING(std/bytes): Adjust APIs based on std-wg discussion (#8612)
Diffstat (limited to 'std/io/bufio.ts')
-rw-r--r-- | std/io/bufio.ts | 12 |
1 files changed, 6 insertions, 6 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; |