Package org.gnome.glib
Class ByteArray
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.glib.ByteArray
- All Implemented Interfaces:
Proxy
This class is used for internal purposes by Java-GI. Java-GI
automatically marshals
GByteArray instances from and to java
byte[] primitives.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newGByteArraywith a reference count of 1.ByteArray(MemorySegment address) Create a ByteArray proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the ByteArray classintreadLen()Read the value of the fieldlen.static ByteArraytake(byte @Nullable [] data) Creates a byte array containing thedata.static ByteArraytakeUnowned(byte @Nullable [] data) Creates a byte array containing thedata.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ByteArray
Create a ByteArray proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ByteArray
public ByteArray()Creates a newGByteArraywith a reference count of 1.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readLen
public int readLen()Read the value of the fieldlen.- Returns:
- The value of the field
len
-
take
Creates a byte array containing thedata.- Parameters:
data- byte data for the array- Returns:
- a new
GByteArray
-
takeUnowned
Creates a byte array containing thedata. The allocated native memory is not freed automatically by Java-GI.- Parameters:
data- byte data for the array- Returns:
- a new
GByteArray
-