com.sun.jna.Native.getDirectBufferPointer()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(314)

本文整理了Java中com.sun.jna.Native.getDirectBufferPointer()方法的一些代码示例,展示了Native.getDirectBufferPointer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.getDirectBufferPointer()方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:getDirectBufferPointer

Native.getDirectBufferPointer介绍

[英]Convert a direct Buffer into a Pointer.
[中]将直接缓冲区转换为指针。

代码示例

代码示例来源:origin: net.java.dev.jna/jna

} else if (Platform.HAS_BUFFERS && Buffer.class.isAssignableFrom(type)) {
  Pointer p = value == null ? null
    : Native.getDirectBufferPointer((Buffer)value);
  setPointer(offset, p);
} else if (NativeMapped.class.isAssignableFrom(type)) {

代码示例来源:origin: com.sun.jna/jna

/** Convert a direct {@link Buffer} into a {@link Pointer}. 
 * @throws IllegalArgumentException if the buffer is not direct.
 * @deprecated Use {@link #getDirectBufferPointer} instead. 
 */
public static Pointer getByteBufferPointer(ByteBuffer b) {
  return getDirectBufferPointer(b);
}

代码示例来源:origin: net.java.dev.jna/jna

} else {
  Pointer oldbp = currentValue == null ? null
    : Native.getDirectBufferPointer((Buffer)currentValue);
  if (oldbp == null || !oldbp.equals(bp)) {
    throw new IllegalStateException("Can't autogenerate a direct buffer on memory read");

代码示例来源:origin: nativelibs4java/JNAerator

@SuppressWarnings("unchecked")
public S use(Buffer b, long byteOffset) {
  useMemory(Native.getDirectBufferPointer(b), (int)byteOffset);
  return (S)this;
}

代码示例来源:origin: com.nativelibs4java/jnaerator-runtime

@SuppressWarnings("unchecked")
public S use(Buffer b, long byteOffset) {
  useMemory(Native.getDirectBufferPointer(b), (int)byteOffset);
  return (S)this;
}

代码示例来源:origin: nativelibs4java/JNAerator

@SuppressWarnings("unchecked")
public S use(Buffer b, long byteOffset) {
  useMemory(Native.getDirectBufferPointer(b), (int)byteOffset);
  return (S)this;
}

代码示例来源:origin: com.truward.tupl/tupl

BufRef(ByteBuffer buffer) {
    mBuffer = buffer;
    mPointer = Pointer.nativeValue(Native.getDirectBufferPointer(buffer));
  }
}

代码示例来源:origin: com.nativelibs4java/jnaerator-runtime

@SuppressWarnings("unchecked")
public S use(Buffer b, long byteOffset) {
  useMemory(Native.getDirectBufferPointer(b), (int)byteOffset);
  return (S)this;
}

代码示例来源:origin: deepspark/deepspark

public void setTrainBuffer(String name, Buffer data, Buffer label, int num) {
  checkValidity();
  train_data = data;
  train_label = label;
  CaffeInterface.INSTANCE.setTrainBuffer(ptrSolver, name, Native.getDirectBufferPointer(data),
      Native.getDirectBufferPointer(label), num);
}

代码示例来源:origin: deepspark/deepspark

public void setTestBuffer(String name, Buffer data, Buffer label, int num) {
  checkValidity();
  test_data = data;
  test_label = label;
  CaffeInterface.INSTANCE.setTestBuffer(ptrSolver, 0, name, Native.getDirectBufferPointer(data),
      Native.getDirectBufferPointer(label), num);
}

代码示例来源:origin: org.cojen/tupl

BufRef(ByteBuffer buffer) {
    mBuffer = buffer;
    mPointer = Pointer.nativeValue(Native.getDirectBufferPointer(buffer));
  }
}

代码示例来源:origin: cojen/Tupl

BufRef(ByteBuffer buffer) {
    mBuffer = buffer;
    mPointer = Pointer.nativeValue(Native.getDirectBufferPointer(buffer));
  }
}

代码示例来源:origin: org.elasticsearch/jna

} else if (Platform.HAS_BUFFERS && Buffer.class.isAssignableFrom(type)) {
  Pointer p = value == null ? null
    : Native.getDirectBufferPointer((Buffer)value);
  setPointer(offset, p);
} else if (NativeMapped.class.isAssignableFrom(type)) {

代码示例来源:origin: org.elasticsearch/jna

} else {
  Pointer oldbp = currentValue == null ? null
    : Native.getDirectBufferPointer((Buffer)currentValue);
  if (oldbp == null || !oldbp.equals(bp)) {
    throw new IllegalStateException("Can't autogenerate a direct buffer on memory read");

相关文章

Native类方法