相关文章推荐
长情的斑马  ·  University of Eastern ...·  6 月前    · 
至今单身的保温杯  ·  飛龍在天- song and lyrics ...·  6 月前    · 
勤奋的充电器  ·  CIE1931色度圖| ...·  6 月前    · 
健壮的墨镜  ·  第四屆「成功人文講座」移民節登場邀請美國MI ...·  6 月前    · 
千年单身的红烧肉  ·  从辩证唯物主义看改革开放的方法论·  7 月前    · 
小百科  ›  com.sun.jna.Pointer.getPointer java code examples | Tabnine
offset
英姿勃勃的黄豆
2 年前
congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Pointer.getPointer
Code Index Add Tabnine to your IDE (free)

How to use
getPointer
method
in
com.sun.jna.Pointer

Best Java code snippets using com.sun.jna . Pointer . getPointer (Showing top 20 results out of 315)

origin: net.java.dev.jna / jna

/** Obtain a pointer to the native glue code for this callback. */
public Pointer getTrampoline() {
  if (trampoline == null) {
    trampoline = cbstruct.getPointer(0);
  return trampoline;
origin: net.java.dev.jna / jna

/**
 * Indirect the native pointer, copying <em>from</em> memory pointed to by
 * native pointer, into the specified array.
 * @param offset byte offset from pointer from which data is copied
 * @param buf    {@link Pointer} array into which data is copied
 * @param index  array index to which data is copied
 * @param length number of elements from native pointer that must be copied
public void read(long offset, Pointer[] buf, int index, int length) {
  for (int i=0;i < length;i++) {
    Pointer p = getPointer(offset + i*Native.POINTER_SIZE);
    Pointer oldp = buf[i+index];
    // Avoid replacing the original pointer if it hasn't changed
    if (oldp == null || p == null || p.peer != oldp.peer) {
      buf[i+index] = p;
origin: net.java.dev.jna / jna

/** Returns an array of {@link Pointer}.  The array length is
 * determined by a NULL-valued terminating element.
public Pointer[] getPointerArray(long offset) {
  List<Pointer> array = new ArrayList<Pointer>();
  int addOffset = 0;
  Pointer p = getPointer(offset);
  while (p != null) {
    array.add(p);
    addOffset += Native.POINTER_SIZE;
    p = getPointer(offset + addOffset);
  return array.toArray(new Pointer[array.size()]);
origin: net.java.dev.jna / jna

/**
 * Indirect the native pointer to <code>malloc</code> space, a la
 * <code>Pointer.getPointer</code>.  But this method performs
 * a bounds checks to ensure that the indirection does not cause memory
 * outside the <code>malloc</code>ed space to be accessed.
 * @see Pointer#getPointer(long)
@Override
public Pointer getPointer(long offset) {
  boundsCheck(offset, Native.POINTER_SIZE);
  return super.getPointer(offset);
origin: net.java.dev.jna / jna

  public Pointer getValue() {
    return getPointer().getPointer(0);
origin: net.java.dev.jna / jna

int addOffset = 0;
if (length != -1) {
  p = getPointer(offset + addOffset);
  int count = 0;
  while (count++ < length) {
    if (count < length) {
      addOffset += Native.POINTER_SIZE;
      p = getPointer(offset + addOffset);
  while ((p = getPointer(offset + addOffset)) != null) {
    String s = p == null
      ? null
origin: net.java.dev.jna / jna

Pointer p = memory.getPointer(offset);
result = p == null ? null : p.getString(0, encoding);
nativeStrings.put(structField.name + ".ptr", memory.getPointer(offset));
nativeStrings.put(structField.name + ".val", result);
origin: net.java.dev.jna / jna

  Structure s = (Structure)currentValue;
  if (Structure.ByReference.class.isAssignableFrom(type)) {
    s = Structure.updateStructureByReference((Class<Structure>) type, s, getPointer(offset));
  } else {
    s.useMemory(this, (int)offset, true);
  result = Double.valueOf(getDouble(offset));
} else if (Pointer.class.isAssignableFrom(type)) {
  Pointer p = getPointer(offset);
  if (p != null) {
    Pointer oldp = currentValue instanceof Pointer
  Pointer p = getPointer(offset);
  result = p != null ? p.getString(0) : null;
} else if (type == WString.class) {
  Pointer p = getPointer(offset);
  result = p != null ? new WString(p.getWideString(0)) : null;
} else if (Callback.class.isAssignableFrom(type)) {
  Pointer fp = getPointer(offset);
  if (fp == null) {
    result = null;
  Pointer bp = getPointer(offset);
  if (bp == null) {
    result = null;
origin: net.java.dev.jna / jna-platform

protected void _invokeNativeVoid(int vtableId, Object[] args) {
  Pointer vptr = this.getPointer().getPointer(0);
  // we take the vtable id and multiply with the pointer size (4 bytes on
  // 32bit OS)
  Function func = Function.getFunction(vptr.getPointer(vtableId
      * Native.POINTER_SIZE));
  func.invokeVoid(args);
origin: net.java.dev.jna / platform

  /**
   * Release.
   * @return the ulong
  public int Release() {
    Pointer vptr = this.getPointer().getPointer(0);
    Function func = Function.getFunction(vptr.getPointer(8));
    return func.invokeInt(new Object[] { this.getPointer() });
origin: net.java.dev.jna / platform

  public/* [local] */void ReleaseVarDesc(
  /* [in] */VARDESC pVarDesc) {
    Pointer vptr = this.getPointer().getPointer(0);
    Function func = Function.getFunction(vptr.getPointer(84));
    func.invokeInt(new Object[] { this.getPointer(), pVarDesc });
origin: net.java.dev.jna / platform

public HRESULT IsName(
/* [annotation][out][in] */
WString szNameBuf,
/* [in] */ULONG lHashVal,
/* [out] */BOOLbyReference pfName) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(40));
  int hr = func.invokeInt(new Object[] { this.getPointer(), szNameBuf,
      lHashVal, pfName });
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public/* [local] */HRESULT GetFuncDesc(
/* [in] */UINT index,
/* [out] */FUNCDESC.ByReference pFuncDesc) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(20));
  int hr = func.invokeInt(new Object[] { this.getPointer(), index,
      pFuncDesc });
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public/* [local] */HRESULT GetNames(
/* [in] */MEMBERID memid,
/* [length_is][size_is][out] */BSTR[] rgBstrNames,
/* [in] */UINT cMaxNames,
/* [out] */UINTbyReference pcNames) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(28));
  int hr = func.invokeInt(new Object[] { this.getPointer(), memid,
      rgBstrNames, cMaxNames, pcNames });
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public HRESULT GetRefTypeOfImplType(
/* [in] */UINT index,
/* [out] */HREFTYPEbyReference pRefType) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(32));
  int hr = func.invokeInt(new Object[] { this.getPointer(), index,
      pRefType });
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public/* [local] */HRESULT GetIDsOfNames(
/* [size_is][in] */WString[] rgszNames,
/* [in] */UINT cNames,
/* [size_is][out] */MEMBERID[] pMemId) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(40));
  int hr = func.invokeInt(new Object[] { this.getPointer(), rgszNames,
      cNames, pMemId });
  return new HRESULT(hr);





    
origin: net.java.dev.jna / platform

public




    
/* [local] */HRESULT CreateInstance(
/* [in] */IUnknown pUnkOuter,
/* [in] */REFIID riid,
/* [iid_is][out] */PointerByReference ppvObj) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(64));
  int hr = func.invokeInt(new Object[] { this.getPointer(), pUnkOuter,
      riid, ppvObj });
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public




    
 HRESULT GetTypeAttr(
/* [out] */TYPEATTR.ByReference pTypeAttr) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer(12));
  int hr = func.invokeInt(new Object[] { this.getPointer(), pTypeAttr });
  pTypeAttr.read();
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

public HRESULT GetTypeComp(
/* [out] */ITypeComp.ByReference pTComp) {
  Pointer vptr = this.getPointer().getPointer(0);
  Function func = Function.getFunction(vptr.getPointer




    
(32));
  PointerByReference ppTComp = new PointerByReference();
  int hr = func.invokeInt(new Object[] { this.getPointer(), ppTComp });
  pTComp.setPointer(ppTComp.getPointer());
  return new HRESULT(hr);
origin: net.java.dev.jna / platform

  public HKEY getValue() {
    Pointer p = getPointer().getPointer(0);
    if (p == null)
      return null;
    if (WinBase.INVALID_HANDLE_VALUE.getPointer().equals(p)) 
      return (HKEY) WinBase.INVALID_HANDLE_VALUE;
    HKEY h = new HKEY();
    h.setPointer(p);
    return h;
com.sun.jna Pointer getPointer

Javadoc

Indirect the native pointer as a pointer to pointer. This is equivalent to the expression *((void **)((char *)Pointer + offset)) .

Popular methods of Pointer

  • getString
    Copy native memory to a Java String. If wide is true, access the memory as an array of wchar_t, othe
  • <init>
    Create from native pointer. Don't use this unless you know what you're doing.
  • getByteArray
    Read a native array of bytes of size arraySize from the given offset from this Pointer.
  • getInt
    Indirect the native pointer as a pointer to int. This is equivalent to the expression*((jint *)((cha
  • write
    Indirect the native pointer, copying into memory pointed to by native pointer, from the specified ar
  • nativeValue
    Set the native peer value. Use with caution.
  • getLong
    Indirect the native pointer as a pointer to long. This is equivalent to the expression*((jlong *)((c
  • createConstant
    Convenience constant, equivalent to (void*)CONSTANT.
  • read
    Indirect the native pointer, copying from memory pointed to by native pointer, into the specified ar
  • setInt
    Set value at location being pointed to. This is equivalent to the expression *((jint *)((char *)Poin
  • equals
    Compares this Pointer to the specified object.
  • setPointer
    Set value at location being pointed to. This is equivalent to the expression
 
推荐文章
长情的斑马  ·  University of Eastern Finland - www.uef.fi
6 月前
至今单身的保温杯  ·  飛龍在天- song and lyrics by 豪記之星| Spotify
6 月前
勤奋的充电器  ·  CIE1931色度圖| Optoelectronics Lab
6 月前
健壮的墨镜  ·  第四屆「成功人文講座」移民節登場邀請美國MIT 學者鄧津華蒞校暢談 ...
6 月前
千年单身的红烧肉  ·  从辩证唯物主义看改革开放的方法论
7 月前
Link管理   ·   Sov5搜索   ·   小百科
小百科 - 百科知识指南