Class BinaryOutput.CCharPointerBinaryOutput
java.lang.Object
org.graalvm.nativebridge.BinaryOutput
org.graalvm.nativebridge.BinaryOutput.CCharPointerBinaryOutput
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
BinaryOutput
public static final class BinaryOutput.CCharPointerBinaryOutput
extends BinaryOutput
implements Closeable
A
BinaryOutput backed by an off-heap memory.-
Nested Class Summary
Nested classes/interfaces inherited from class org.graalvm.nativebridge.BinaryOutput
BinaryOutput.ByteArrayBinaryOutput, BinaryOutput.CCharPointerBinaryOutput -
Field Summary
Fields inherited from class org.graalvm.nativebridge.BinaryOutput
pos -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the buffer and frees off-heap allocated resources.create(int initialSize) Creates a new buffer backed by an off-heap memory segment.org.graalvm.nativeimage.c.type.CCharPointerReturns an address of an off-heap memory segment containing the marshalled data.intReturns this buffer's position.voidskip(int numberOfBytes) Reserves a buffer space.voidwrite(byte[] b, int off, int len) Writeslenbytes from the bytearraystarting at offsetoff.voidwrite(int b) Writes the lowest byte of the argument as a single byte value.Methods inherited from class org.graalvm.nativebridge.BinaryOutput
create, create, create, isTypedValue, write, write, write, write, write, write, write, writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeTypedValue, writeUTF
-
Method Details
-
getPosition
public int getPosition()Description copied from class:BinaryOutputReturns this buffer's position.- Overrides:
getPositionin classBinaryOutput
-
getAddress
public org.graalvm.nativeimage.c.type.CCharPointer getAddress()Returns an address of an off-heap memory segment containing the marshalled data. -
write
public void write(int b) Description copied from class:BinaryOutputWrites the lowest byte of the argument as a single byte value. The buffer position is incremented by1.- Specified by:
writein classBinaryOutput
-
write
public void write(byte[] b, int off, int len) Description copied from class:BinaryOutputWriteslenbytes from the bytearraystarting at offsetoff. The buffer position is incremented bylen.- Specified by:
writein classBinaryOutput
-
skip
public void skip(int numberOfBytes) Description copied from class:BinaryOutputReserves a buffer space. The reserved space can be used for out parameters.- Specified by:
skipin classBinaryOutput- Parameters:
numberOfBytes- number of bytes to reserve.
-
close
public void close()Closes the buffer and frees off-heap allocated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
create
Creates a new buffer backed by an off-heap memory segment. The buffer initial size isinitialSize.
-