Class FileUtilJNA

java.lang.Object
oshi.jna.util.FileUtilJNA

@ThreadSafe public final class FileUtilJNA extends Object
JNA-specific extensions to FileUtil for reading native types from buffers and freeing native memory.
  • Method Details

    • readNativeLongFromBuffer

      public static NativeLong readNativeLongFromBuffer(ByteBuffer buff)
      Reads a NativeLong value from a ByteBuffer
      Parameters:
      buff - The bytebuffer to read from
      Returns:
      The next value
    • readSizeTFromBuffer

      public static LibCAPI.size_t readSizeTFromBuffer(ByteBuffer buff)
      Reads a size_t value from a ByteBuffer
      Parameters:
      buff - The bytebuffer to read from
      Returns:
      The next value
    • readPointerFromBuffer

      public static Pointer readPointerFromBuffer(ByteBuffer buff)
      Reads a Pointer value from a ByteBuffer
      Parameters:
      buff - The bytebuffer to read from
      Returns:
      The next value
    • freeMemory

      public static void freeMemory(Pointer p)
      If the given Pointer is of class Memory, executes the close method on it to free its native allocation
      Parameters:
      p - A pointer