Class PollableOutputStream.PollableOutputStreamInterface

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInterface
org.gnome.gio.PollableOutputStream.PollableOutputStreamInterface
All Implemented Interfaces:
Proxy
Enclosing interface:
PollableOutputStream

public static class PollableOutputStream.PollableOutputStreamInterface extends TypeInterface

The interface for pollable output streams.

The default implementation of canPoll always returns true.

The default implementation of writeNonblocking calls g_pollable_output_stream_is_writable(), and then calls g_output_stream_write() if it returns true. This means you only need to override it if it is possible that your isWritable implementation may return true when the stream is not actually writable.

The default implementation of writevNonblocking calls g_pollable_output_stream_write_nonblocking() for each vector, and converts its return value and error (if set) to a GPollableReturn. You should override this where possible to avoid having to allocate a GError to return IOErrorEnum.WOULD_BLOCK.

Since:
2.28
  • Constructor Details

    • PollableOutputStreamInterface

      public PollableOutputStreamInterface(MemorySegment address)
      Create a PollableOutputStreamInterface proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • overrideCanPoll

      public void overrideCanPoll(Arena arena, @Nullable Method method)
      Override virtual method can_poll.
      Parameters:
      method - the method to invoke
    • overrideIsWritable

      public void overrideIsWritable(Arena arena, @Nullable Method method)
      Override virtual method is_writable.
      Parameters:
      method - the method to invoke
    • overrideCreateSource

      public void overrideCreateSource(Arena arena, @Nullable Method method)
      Override virtual method create_source.
      Parameters:
      method - the method to invoke
    • overrideWriteNonblocking

      public void overrideWriteNonblocking(Arena arena, @Nullable Method method)
      Override virtual method write_nonblocking.
      Parameters:
      method - the method to invoke
    • overrideWritevNonblocking

      public void overrideWritevNonblocking(Arena arena, @Nullable Method method)
      Override virtual method writev_nonblocking.
      Parameters:
      method - the method to invoke