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.
  • Method Details

    • getPosition

      public int getPosition()
      Description copied from class: BinaryOutput
      Returns this buffer's position.
      Overrides:
      getPosition in class BinaryOutput
    • 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: BinaryOutput
      Writes the lowest byte of the argument as a single byte value. The buffer position is incremented by 1.
      Specified by:
      write in class BinaryOutput
    • write

      public void write(byte[] b, int off, int len)
      Description copied from class: BinaryOutput
      Writes len bytes from the byte array starting at offset off. The buffer position is incremented by len.
      Specified by:
      write in class BinaryOutput
    • skip

      public void skip(int numberOfBytes)
      Description copied from class: BinaryOutput
      Reserves a buffer space. The reserved space can be used for out parameters.
      Specified by:
      skip in class BinaryOutput
      Parameters:
      numberOfBytes - number of bytes to reserve.
    • close

      public void close()
      Closes the buffer and frees off-heap allocated resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • create

      public static BinaryOutput.CCharPointerBinaryOutput create(int initialSize)
      Creates a new buffer backed by an off-heap memory segment. The buffer initial size is initialSize.