GLib.IOChannel.prototype.set_buffered
function set_buffered(buffered: Boolean): void { // Gjs wrapper for g_io_channel_set_buffered() }
The buffering state can only be set if the channel's encoding is null. For any other encoding, the channel must be buffered.
A buffered channel can only be set unbuffered if the channel's internal buffers have been flushed. Newly created channels or channels which have returned GLib.IOStatus.eof not require such a flush. For write-only channels, a call to g_io_channel_flush () is sufficient. For all other channels, the buffers may be flushed by a call to g_io_channel_seek_position (). This includes the possibility of seeking with seek type GLib.SeekType.cur and an offset of zero. Note that this means that socket-based channels cannot be set unbuffered once they have had data read from them.
On unbuffered channels, it is safe to mix read and write calls from the new and old APIs, if this is necessary for maintaining old code.
The default state of the channel is buffered.
- buffered
whether to set the channel buffered or unbuffered