Documentation for method out-buffer assembled from the following pages:

Class: IO::CatHandle §

From IO::CatHandle

(IO::CatHandle) method out-buffer §

Defined as:

multi method out-buffer(|)

The IO::CatHandle type overrides this method to throw a X::NYI exception. If you have a good idea for how this method should behave, tell Rakudo developers about it!

Class: IO::Handle §

From IO::Handle

(IO::Handle) method out-buffer §

Defined as:

method out-buffer(--> Int:Dis rw

Controls output buffering and can be set via an argument to open. Takes an int as the size of the buffer to use (zero is acceptable). Can take a Bool: True means to use default, implementation-defined buffer size; False means to disable buffering (equivalent to using 0 as buffer size).

Lastly, can take a Nil to enable TTY-based buffering control: if the handle is a TTY, the buffering is disabled, otherwise, default, implementation-defined buffer size is used.

See flush to write out data currently in the buffer. Changing buffer size flushes the filehandle.

given 'foo'.IO.open: :w:1000out-buffer {
    .say: 'Hello world!'# buffered 
    .out-buffer = 42;       # buffer resized; previous print flushed 
    .say: 'And goodbye';
    .close# closing the handle flushes the buffer 
}