Package org.gnome.gio
Class MemoryOutputStream.Builder<B extends MemoryOutputStream.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gio.OutputStream.Builder<B>
org.gnome.gio.MemoryOutputStream.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
MemoryOutputStream
public static class MemoryOutputStream.Builder<B extends MemoryOutputStream.Builder<B>>
extends OutputStream.Builder<B>
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theMemoryOutputStream
object.setData
(MemorySegment data) Pointer to buffer where data will be written.setDestroyFunction
(MemorySegment destroyFunction) Function called with the buffer as argument when the stream is destroyed.setReallocFunction
(MemorySegment reallocFunction) Function with realloc semantics called to enlarge the buffer.setSize
(int size) Current size of the data buffer.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theMemoryOutputStream
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toMemoryOutputStream
.- Overrides:
build
in classOutputStream.Builder<B extends MemoryOutputStream.Builder<B>>
- Returns:
- a new instance of
MemoryOutputStream
with the properties that were set in the Builder object.
-
setData
Pointer to buffer where data will be written.- Parameters:
data
- the value for thedata
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDestroyFunction
Function called with the buffer as argument when the stream is destroyed.- Parameters:
destroyFunction
- the value for thedestroy-function
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setReallocFunction
Function with realloc semantics called to enlarge the buffer.- Parameters:
reallocFunction
- the value for therealloc-function
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSize
Current size of the data buffer.- Parameters:
size
- the value for thesize
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-