Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: BufferedInputStreamMeta

[255:14] static extends: object

Generated metadata helpers for BufferedInputStream class surfaces.

Methods

  • properties ()

    Returns property metadata for BufferedInputStream.

    • @r A list.

class: BufferedInputStream

[21:7] extends: object

Buffered input stream implements [class@Gio.FilterInputStream] and provides for buffered reads. By default, GBufferedInputStream's buffer size is set at 4 kilobytes. To create a buffered input stream, use [ctor@Gio.BufferedInputStream.new], or [ctor@Gio.BufferedInputStream.new_sized] to specify the buffer's size at construction. To get the size of a buffer within a buffered input stream, use [method@Gio.BufferedInputStream.get_buffer_size]. To change the size of a buffered input stream's buffer, use [method@Gio.BufferedInputStream.set_buffer_size]. Note that the buffer's size cannot be reduced below the size of the data within the buffer.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • BufferedInputStream (base_stream = null)

    Creates a new [class@Gio.InputStream] from the given @base_stream, with a buffer set to the default size (4 kilobytes).

    • @p base_stream is a [class@Gio.InputStream].
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asFilterInputStream ()

    Wraps this handle as FilterInputStream.

    • @r A FilterInputStream object.
  • asSeekable ()

    Wraps this handle as Seekable.

    • @r A Seekable object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setBuffersize (int Value)

    The size of the backend buffer, in bytes.

    • @p Value is the new property value.
    • @r None.
  • fill (int count, object cancellable)

    Tries to read @count bytes from the stream into the buffer. Will block during this read. If @count is zero, returns zero and does nothing. A value of @count larger than G_MAXSSIZE will cause a [error@Gio.IOErrorEnum.INVALID_ARGUMENT] error. On success, the number of bytes read into the buffer is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file. Zero is returned on end of file (or if @count is zero), but never otherwise. If @count is -1 then the attempted read size is equal to the number of bytes that are required to fill the buffer. If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly. For the asynchronous, non-blocking, version of this function, see [method@Gio.BufferedInputStream.fill_async].

    • @p count is the number of bytes that will be read from the stream.
    • @p cancellable is optional [class@Gio.Cancellable] object, NULL to ignore.
  • fill_finish (object result)

    Finishes an asynchronous read.

    • @p result is a [iface@Gio.AsyncResult].
  • get_available ()

    Gets the size of the available data within the stream.

  • get_buffer_size ()

    Gets the size of the input buffer.

  • read_byte (object cancellable)

    Tries to read a single byte from the stream or the buffer. Will block during this read. On success, the byte read from the stream is returned. On end of stream -1 is returned but it's not an exceptional error and

    • @error is not set. If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly.
    • @p cancellable is optional [class@Gio.Cancellable] object, NULL to ignore.
  • set_buffer_size (int size)

    Sets 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.

    • @p size is a #gsize.
    • @r None.

class: BufferedInputStreamCtors

[236:14] static extends: object

Alternate constructors for BufferedInputStream. Usage: BufferedInputStreamCtors.<name>(...). The primary constructor lives directly on BufferedInputStream.

Methods

  • newSized (object base_stream, int size)

    Creates a new [class@Gio.BufferedInputStream] from the given

    • @base_stream, with a buffer set to @size.
    • @p base_stream is a [class@Gio.InputStream].
    • @p size is a #gsize.
    • @r A new BufferedInputStream.