1.6 <GBufferedOutputStream>

Class: <GBufferedOutputStream>

It derives from <GFilterOutputStream>.

Buffered output stream implements <GFilterOutputStream> and provides for buffered writes.

By default, <GBufferedOutputStream>’s buffer size is set at 4 kilobytes.

To create a buffered output stream, use buffered-output-stream:new, or buffered-output-stream:new-sized to specify the buffer’s size at construction.

To get the size of a buffer within a buffered input stream, use buffered-output-stream:get-buffer-size. To change the size of a buffered output stream’s buffer, use buffered-output-stream:set-buffer-size. Note that the buffer’s size cannot be reduced below the size of the data within the buffer.

Fields

parent-instance
priv

Properties

Property: buffered-output-stream:auto-grow self

Whether the buffer should automatically grow.

Its value is a boolean.

Set it with (set! (buffered-output-stream:auto-grow self) value).

Property: buffered-output-stream:buffer-size self

The size of the backend buffer, in bytes.

Its value is an unsigned 32-bit integer.

Set it with (set! (buffered-output-stream:buffer-size self) value).

Procedures

Method: buffered-output-stream:get-auto-grow? self ⇒ %return
Method: get-auto-grow? self ⇒ %return

Checks if the buffer automatically grows as data is added.

self

Passed: a <GBufferedOutputStream>.

a <GBufferedOutputStream>.

%return

Returned: a boolean.

TRUE if the self’s buffer automatically grows, FALSE otherwise.

Method: buffered-output-stream:get-buffer-size self ⇒ %return
Method: get-buffer-size self ⇒ %return

Gets the size of the buffer in the self.

self

Passed: a <GBufferedOutputStream>.

a <GBufferedOutputStream>.

%return

Returned: an unsigned 64-bit integer.

the current size of the buffer.

Procedure: buffered-output-stream:new base-stream ⇒ %return

Creates a new buffered output stream for a base stream.

base-stream

Passed: a <GOutputStream>.

a <GOutputStream>.

%return

Returned: a <GOutputStream>.

a <GOutputStream> for the given base-stream.

Procedure: buffered-output-stream:new-sized base-stream size ⇒ %return

Creates a new buffered output stream with a given buffer size.

base-stream

Passed: a <GOutputStream>.

a <GOutputStream>.

size

Passed: an unsigned 64-bit integer.

a gsize.

%return

Returned: a <GOutputStream>.

a <GOutputStream> with an internal buffer set to size.

Method: buffered-output-stream:set-auto-grow self auto-grow
Method: set-auto-grow self auto-grow

Sets whether or not the self’s buffer should automatically grow. If auto-grow is true, then each write will just make the buffer larger, and you must manually flush the buffer to actually write out the data to the underlying stream.

self

Passed: a <GBufferedOutputStream>.

a <GBufferedOutputStream>.

auto-grow

Passed: a boolean.

a gboolean.

Method: buffered-output-stream:set-buffer-size self size
Method: set-buffer-size self size

Sets the size of the internal buffer to size.

self

Passed: a <GBufferedOutputStream>.

a <GBufferedOutputStream>.

size

Passed: an unsigned 64-bit integer.

a gsize.