outgoingMessage.write(chunk[, encoding][, callback])
chunk<string> | <Buffer> | <Uint8Array>encoding<string> 默认:utf8callback<Function>- 返回:<boolean>
发送一段主体内容。此方法可以被多次调用。
【Sends a chunk of the body. This method can be called multiple times.】
encoding 参数仅在 chunk 是字符串时才相关。默认值为 'utf8'。
【The encoding argument is only relevant when chunk is a string. Defaults to
'utf8'.】
callback 参数是可选的,当这一数据块被刷新时将被调用。
【The callback argument is optional and will be called when this chunk of data
is flushed.】
如果整个数据已成功刷新到内核缓冲区,则返回 true。如果全部或部分数据被排入用户内存,则返回 false。当缓冲区再次空闲时,会触发 'drain' 事件。
【Returns true if the entire data was flushed successfully to the kernel
buffer. Returns false if all or part of the data was queued in the user
memory. The 'drain' event will be emitted when the buffer is free again.】