Class MemoryInputStream

All Implemented Interfaces:
PointerInterface

public class MemoryInputStream extends InputStream
#GMemoryInputStream is a class for using arbitrary
memory chunks as input for GIO streaming input operations.

As of GLib 2.34, #GMemoryInputStream implements
#GPollableInputStream.

https://docs.gtk.org/gio/class.MemoryInputStream.html

  • Constructor Details

    • MemoryInputStream

      public MemoryInputStream(PointerContainer pointer)
    • MemoryInputStream

      public MemoryInputStream()
      Creates a new empty #GMemoryInputStream.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newFromBytesMemoryInputStream

      public static MemoryInputStream newFromBytesMemoryInputStream(@Nonnull Bytes bytes)
      Creates a new #GMemoryInputStream with data from the given @bytes.
      Parameters:
      bytes - a #GBytes
      Returns:
      new #GInputStream read from @bytes
    • newFromDataMemoryInputStream

      public static MemoryInputStream newFromDataMemoryInputStream(@Nonnull Pointer data, long len, MemoryInputStream.OnDestroyNotify destroy)
      Creates a new #GMemoryInputStream with data in memory of a given size.
      Parameters:
      data - input data
      len - length of the data, may be -1 if @data is a nul-terminated string
      destroy - function that is called to free @data, or %NULL
      Returns:
      new #GInputStream read from @data of @len bytes.
    • addBytes

      public void addBytes(@Nonnull Bytes bytes)
      Appends @bytes to data that can be read from the input stream.
      Parameters:
      bytes - input data
    • addData

      public void addData(@Nonnull Pointer data, long len, MemoryInputStream.OnDestroyNotify destroy)
      Appends @data to data that can be read from the input stream
      Parameters:
      data - input data
      len - length of the data, may be -1 if @data is a nul-terminated string
      destroy - function that is called to free @data, or %NULL
    • asPollableInputStream

      public PollableInputStream asPollableInputStream()
      Implements interface PollableInputStream. Call this to get access to interface functions.
      Returns:
      PollableInputStream
    • asSeekable

      public Seekable asSeekable()
      Implements interface Seekable. Call this to get access to interface functions.
      Returns:
      Seekable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()