Package org.gnome.glib
Class ByteArray
java.lang.Object
io.github.jwharm.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
ConstructorDescriptionCreates a newGByteArray
with a reference count of 1.ByteArray
(MemorySegment address) Create a ByteArray proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the ByteArray classint
readLen()
Read the value of the fieldlen
.static ByteArray
take
(byte[] data) Creates a byte array containing thedata
.static ByteArray
takeUnowned
(byte[] data) Creates a byte array containing thedata
.Methods inherited from class io.github.jwharm.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 newGByteArray
with 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
-