0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

docs: update alternative APIs for write(), writeSync(), read() and readSync() (#20792)

Closes #20701
This commit is contained in:
Asher Gomez 2023-10-05 19:44:37 +11:00 committed by GitHub
parent 1ff525e25b
commit fd4fc2d818
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1877,9 +1877,8 @@ declare namespace Deno {
* not indicate EOF.
*
* This function is one of the lowest level APIs and most users should not
* work with this directly, but rather use
* [`readAll()`](https://deno.land/std/streams/read_all.ts?s=readAll) from
* [`std/streams/read_all.ts`](https://deno.land/std/streams/read_all.ts)
* work with this directly, but rather use {@linkcode ReadableStream} and
* {@linkcode https://deno.land/std/streams/mod.ts?s=toArrayBuffer|toArrayBuffer}
* instead.
*
* **It is not guaranteed that the full buffer will be read in a single call.**
@ -1907,10 +1906,8 @@ declare namespace Deno {
* not indicate EOF.
*
* This function is one of the lowest level APIs and most users should not
* work with this directly, but rather use
* [`readAllSync()`](https://deno.land/std/streams/read_all.ts?s=readAllSync)
* from
* [`std/streams/read_all.ts`](https://deno.land/std/streams/read_all.ts)
* work with this directly, but rather use {@linkcode ReadableStream} and
* {@linkcode https://deno.land/std/streams/mod.ts?s=toArrayBuffer|toArrayBuffer}
* instead.
*
* **It is not guaranteed that the full buffer will be read in a single
@ -1932,10 +1929,9 @@ declare namespace Deno {
/** Write to the resource ID (`rid`) the contents of the array buffer (`data`).
*
* Resolves to the number of bytes written. This function is one of the lowest
* level APIs and most users should not work with this directly, but rather use
* [`writeAll()`](https://deno.land/std/streams/write_all.ts?s=writeAll) from
* [`std/streams/write_all.ts`](https://deno.land/std/streams/write_all.ts)
* instead.
* level APIs and most users should not work with this directly, but rather
* use {@linkcode WritableStream}, {@linkcode ReadableStream.from} and
* {@linkcode ReadableStream.pipeTo}.
*
* **It is not guaranteed that the full buffer will be written in a single
* call.**
@ -1957,11 +1953,8 @@ declare namespace Deno {
*
* Returns the number of bytes written. This function is one of the lowest
* level APIs and most users should not work with this directly, but rather
* use
* [`writeAllSync()`](https://deno.land/std/streams/write_all.ts?s=writeAllSync)
* from
* [`std/streams/write_all.ts`](https://deno.land/std/streams/write_all.ts)
* instead.
* use {@linkcode WritableStream}, {@linkcode ReadableStream.from} and
* {@linkcode ReadableStream.pipeTo}.
*
* **It is not guaranteed that the full buffer will be written in a single
* call.**