Where DotWriter.write puts its text: anything with a write(text) method. That is a
Node.js Writable such as process.stdout or a file stream, a WritableStreamDefaultWriter, or
a collector of one's own. It is the counterpart of Java's Appendable.
The writer passes the text in chunks of about 8 KiB characters, not piece by piece, and ignores
what write returns: a Node.js stream buffers past its high-water mark, and the promise of a
stream writer is not awaited. A write that throws ends the writing with its error.
Only a write that throws fails the call, as Java's IOException does. A Node.js stream reports
its errors through its 'error' event, and a WritableStreamDefaultWriter through its promises
(writer.closed, writer.close()), after the call has returned. The caller must watch these, as
Node.js otherwise ends the process on such an error. For an error that fails the call itself, use
a sink that writes synchronously, such as one that calls fs.writeSync.
Where DotWriter.write puts its text: anything with a
write(text)method. That is a Node.jsWritablesuch asprocess.stdoutor a file stream, aWritableStreamDefaultWriter, or a collector of one's own. It is the counterpart of Java'sAppendable.The writer passes the text in chunks of about 8 KiB characters, not piece by piece, and ignores what
writereturns: a Node.js stream buffers past its high-water mark, and the promise of a stream writer is not awaited. Awritethat throws ends the writing with its error.Only a
writethat throws fails the call, as Java'sIOExceptiondoes. A Node.js stream reports its errors through its'error'event, and aWritableStreamDefaultWriterthrough its promises (writer.closed,writer.close()), after the call has returned. The caller must watch these, as Node.js otherwise ends the process on such an error. For an error that fails the call itself, use a sink that writes synchronously, such as one that callsfs.writeSync.