Class BufferedOutputStream

All Implemented Interfaces:
PointerInterface

public class BufferedOutputStream extends FilterOutputStream
Buffered output stream implements #GFilterOutputStream and provides
for buffered writes.

By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.

To create a buffered output stream, use g_buffered_output_stream_new(),
or g_buffered_output_stream_new_sized() to specify the buffer's size
at construction.

To get the size of a buffer within a buffered input stream, use
g_buffered_output_stream_get_buffer_size(). To change the size of a
buffered output stream's buffer, use
g_buffered_output_stream_set_buffer_size(). Note that the buffer's
size cannot be reduced below the size of the data within the buffer.

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

  • Constructor Details

    • BufferedOutputStream

      public BufferedOutputStream(PointerContainer pointer)
    • BufferedOutputStream

      public BufferedOutputStream(@Nonnull OutputStream base_stream)
      Creates a new buffered output stream for a base stream.
      Parameters:
      base_stream - a #GOutputStream.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newSizedBufferedOutputStream

      public static BufferedOutputStream newSizedBufferedOutputStream(@Nonnull OutputStream base_stream, long size)
      Creates a new buffered output stream with a given buffer size.
      Parameters:
      base_stream - a #GOutputStream.
      size - a #gsize.
      Returns:
      a #GOutputStream with an internal buffer set to @size.
    • getAutoGrow

      public boolean getAutoGrow()
      Checks if the buffer automatically grows as data is added.
      Returns:
      %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
    • getBufferSize

      public long getBufferSize()
      Gets the size of the buffer in the @stream.
      Returns:
      the current size of the buffer.
    • setAutoGrow

      public void setAutoGrow(boolean auto_grow)
      Sets whether or not the @stream's buffer should automatically grow.
      If @auto_grow is true, then each write will just make the buffer
      larger, and you must manually flush the buffer to actually write out
      the data to the underlying stream.
      Parameters:
      auto_grow - a #gboolean.
    • setBufferSize

      public void setBufferSize(long size)
      Sets the size of the internal buffer to @size.
      Parameters:
      size - a #gsize.
    • 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()