gio.buffered_input_stream

Module for [BufferedInputStream] class

Types 3

Buffered input stream implements #GFilterInputStream and provides for buffered reads.

By default, gio.buffered_input_stream.BufferedInputStream's buffer size is set at 4 kilobytes.

To create a buffered input stream, use gio.buffered_input_stream.BufferedInputStream.new_, or gio.buffered_input_stream.BufferedInputStream.newSized to specify the buffer's size at construction.

To get the size of a buffer within a buffered input stream, use gio.buffered_input_stream.BufferedInputStream.getBufferSize. To change the size of a buffered input stream's buffer, use gio.buffered_input_stream.BufferedInputStream.setBufferSize. Note that the buffer's size cannot be reduced below the size of the data within the buffer.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
BufferedInputStream self() nothrowReturns `this`, for use in `with` statements.
BufferedInputStreamGidBuilder builder() static nothrowGet builder for [gio.buffered_input_stream.BufferedInputStream] Returns: New builder object
uint bufferSize() @property nothrowGet `bufferSize` property. Returns: The size of the backend buffer, in bytes.
void bufferSize(uint propval) @property nothrowSet `bufferSize` property. Params: propval = The size of the backend buffer, in bytes.
gio.buffered_input_stream.BufferedInputStream newSized(gio.input_stream.InputStream baseStream, size_t size) static nothrowCreates a new #GBufferedInputStream from the given base_stream, with a buffer set to size.
ptrdiff_t fill(ptrdiff_t count, gio.cancellable.Cancellable cancellable = null)Tries to read count bytes from the stream into the buffer. Will block during this read.
void fillAsync(ptrdiff_t count, int ioPriority, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowReads data into stream's buffer asynchronously, up to count size. io_priority can be used to prioritize reads. For the synchronous version of this function, see [gio.buffered_input_stream.BufferedI...
ptrdiff_t fillFinish(gio.async_result.AsyncResult result)Finishes an asynchronous read.
size_t getAvailable() nothrowGets the size of the available data within the stream. Returns: size of the available stream.
size_t getBufferSize() nothrowGets the size of the input buffer. Returns: the current buffer size.
size_t peek(ubyte[] buffer, size_t offset) nothrowPeeks in the buffer, copying data of size count into buffer, offset offset bytes.
ubyte[] peekBuffer() nothrowReturns the buffer with the currently available bytes. The returned buffer must not be modified and will become invalid when reading from the stream or filling the buffer. Returns: read-only buffer
int readByte(gio.cancellable.Cancellable cancellable = null)Tries to read a single byte from the stream or the buffer. Will block during this read.
void setBufferSize(size_t size) nothrowSets the size of the internal buffer of stream to size, or to the size of the contents of the buffer. The buffer can never be resized smaller than its current contents.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.input_stream.InputStream baseStream)Creates a new #GInputStream from the given base_stream, with a buffer set to the default size (4 kilobytes).

Fluent builder implementation template for gio.buffered_input_stream.BufferedInputStream

Methods
T bufferSize(uint propval) nothrowSet `bufferSize` property. Params: propval = The size of the backend buffer, in bytes. Returns: Builder instance for fluent chaining