Class SimpleIOStream

All Implemented Interfaces:
AutoCloseable, Proxy, AutoCloseable

@Generated("org.javagi.JavaGI") public class SimpleIOStream extends IOStream

GSimpleIOStream creates a IOStream from an arbitrary InputStream and OutputStream. This allows any pair of input and output streams to be used with IOStream methods.

This is useful when you obtained a InputStream and a OutputStream by other means, for instance creating them with platform specific methods as g_unix_input_stream_new() (from gio-unix-2.0.pc / GioUnix-2.0), and you want to take advantage of the methods provided by IOStream.

Since:
2.44
  • Constructor Details

    • SimpleIOStream

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

      public SimpleIOStream(InputStream inputStream, OutputStream outputStream)
      Creates a new GSimpleIOStream wrapping inputStream and outputStream. See also GIOStream.
      Parameters:
      inputStream - a GInputStream.
      outputStream - a GOutputStream.
      Since:
      2.44
    • SimpleIOStream

      public SimpleIOStream()
      Create a new SimpleIOStream.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the SimpleIOStream class.
      Returns:
      the GType
    • getMemoryLayout

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

      protected SimpleIOStream asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class IOStream
      Returns:
      the instance as if it were its parent type
    • builder

      public static SimpleIOStream.Builder<? extends SimpleIOStream.Builder> builder()
      A SimpleIOStream.Builder object constructs a SimpleIOStream with the specified properties. Use the various set...() methods to set properties, and finish construction with SimpleIOStream.Builder.build().
      Returns:
      the builder object