public void setValue(Pointer value) { getPointer().setPointer(0, value); }
public Pointer getValue() { return getPointer().getPointer(0); } }
public void setValue(Pointer value) { getPointer().setPointer(0, value); }
public Pointer getValue() { return getPointer().getPointer(0); } }
public Pointer getValue() { return getPointer().getPointer(0); } }
public void setValue(Pointer value) { getPointer().setPointer(0, value); }
PointerByReference pParam1 = new PointerByReference(); ret = DCCAPI.myCFunction( pParam1, p2, p1); and then i retrieve the string ; Pointer ptrParam1 = pParam1.getPointer(); String sTemp = ptrParam1.getString(0);
@Override public Pointer lock(Pointer opaque, PointerByReference planes) { Pointer[] pointers = nativeBuffers.pointers(); planes.getPointer().write(0, pointers, 0, pointers.length); return null; }
private static final long ptr2long(Pointer ptr) { return new PointerByReference(ptr).getPointer().getInt(0); }
public Pointer call( Pointer jsContextRef, Pointer jsFunction, Pointer thisObject, int argumentCount, PointerByReference ref, Pointer exception ) throws Exception { JSC jsc = shell.jsc(); int size = Native.getNativeSize(Pointer.class); Object[] args = new Object[argumentCount]; for (int i = 0, offset = 0; i < argumentCount; i++, offset += size) { args[i] = convertToJava(jsc, method.getParameterTypes()[i], ref.getPointer().getPointer(offset)); } return convertFromJava(method.invoke(vm, args))[0]; } }
public byte[] next() { levelDB.checkDatabaseOpen(); checkIteratorOpen(); PointerByReference resultLengthPointer = new PointerByReference(); PointerByReference resultPointer = LevelDBNative.leveldb_iter_key(iterator, resultLengthPointer); long resultLength; if (Native.POINTER_SIZE == 8) { resultLength = resultLengthPointer.getPointer().getLong(0); } else { resultLength = resultLengthPointer.getPointer().getInt(0); } byte[] key = resultPointer.getPointer().getByteArray(0, (int) resultLength); LevelDBNative.leveldb_iter_next(iterator); return key; } }
@Override public void putPointer(long offset, Pointer value) { PointerByReference ref = new PointerByReference(value); if (Platform.getPlatform().longSize() == 32) { putInt(offset, ref.getPointer().getInt(0)); } else { putLong(offset, ref.getPointer().getLong(0)); } }
/** * Creates a new Voikko instance * @param language BCP 47 language tag to be used * @param path Extra path that will be checked first when looking for linguistic resources */ public Voikko(String language, String path) { PointerByReference error = new PointerByReference(); handle = getLib().voikkoInit(error, s2n(language), s2n(path)); if (handle == null && error.getPointer() != Pointer.NULL) { handle = null; throw new VoikkoException(stringFromPointer(error.getPointer().getPointer(0))); } }
/** * Set the desired video format properties - space for these structures is already allocated by LibVlc, we * simply fill the existing memory. * <p> * The {@link BufferFormat} class restricts the chroma to maximum four bytes, so we don't need check it here, we * do however need to check if it is less than four. * * @param chroma * @param width * @param height * @param pitches * @param lines */ private void applyBufferFormat(BufferFormat bufferFormat, PointerByReference chroma, IntByReference width, IntByReference height, PointerByReference pitches, PointerByReference lines) { byte[] chromaBytes = bufferFormat.getChroma().getBytes(); chroma.getPointer().write(0, chromaBytes, 0, chromaBytes.length < 4 ? chromaBytes.length : 4); width.setValue(bufferFormat.getWidth()); height.setValue(bufferFormat.getHeight()); int[] pitchValues = bufferFormat.getPitches(); int[] lineValues = bufferFormat.getLines(); pitches.getPointer().write(0, pitchValues, 0, pitchValues.length); lines.getPointer().write(0, lineValues, 0, lineValues.length); }
/** * Cleans up the native memory resources if allocated. */ @Override public void close() throws Exception { if (pCodec != null) { OpenJp2.opj_destroy_codec(pCodec.getPointer()); } if (pStream != null && pStream.getValue() != null) { OpenJp2.opj_stream_destroy(pStream); } if (pImage != null && pImage.getValue() != null) { OpenJp2.opj_image_destroy(pImage.getPointer()); } } }
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); }
public/* [local] */HRESULT GetContainingTypeLib( /* [out] */ITypeLib.ByReference pTLib, /* [out] */UINTbyReference pIndex) { Pointer vptr = this.getPointer().getPointer(0); Function func = Function.getFunction(vptr.getPointer(72)); PointerByReference ppTLib = new PointerByReference(); int hr = func.invokeInt(new Object[] { this.getPointer(), ppTLib, pIndex }); pTLib.setPointer(ppTLib.getPointer()); return new HRESULT(hr); }
public HRESULT GetTypeInfoOfGuid( /* [in] */GUID guid, /* [out] */ITypeInfo.ByReference pTinfo) { Pointer vptr = this.getPointer().getPointer(0); Function func = Function.getFunction(vptr.getPointer(24)); PointerByReference ppTinfo = new PointerByReference(); int hr = func.invokeInt(new Object[] { this.getPointer(), guid, ppTinfo }); pTinfo.setPointer(ppTinfo.getPointer()); return new HRESULT(hr); }
/** * Return the domain/workgroup join status for a computer. * @param computerName Computer name. * @return Join status. */ public static int getJoinStatus(String computerName) { PointerByReference lpNameBuffer = new PointerByReference(); IntByReference bufferType = new IntByReference(); try { int rc = Netapi32.INSTANCE.NetGetJoinInformation(computerName, lpNameBuffer, bufferType); if (LMErr.NERR_Success != rc) { throw new Win32Exception(rc); } return bufferType.getValue(); } finally { if (lpNameBuffer.getPointer() != null) { int rc = Netapi32.INSTANCE.NetApiBufferFree(lpNameBuffer.getValue()); if (LMErr.NERR_Success != rc) { throw new Win32Exception(rc); } } } }
/** * Return the domain/workgroup join status for a computer. * @param computerName Computer name. * @return Join status. */ public static int getJoinStatus(String computerName) { PointerByReference lpNameBuffer = new PointerByReference(); IntByReference bufferType = new IntByReference(); try { int rc = Netapi32.INSTANCE.NetGetJoinInformation(computerName, lpNameBuffer, bufferType); if (LMErr.NERR_Success != rc) { throw new Win32Exception(rc); } return bufferType.getValue(); } finally { if (lpNameBuffer.getPointer() != null) { int rc = Netapi32.INSTANCE.NetApiBufferFree(lpNameBuffer.getValue()); if (LMErr.NERR_Success != rc) { throw new Win32Exception(rc); } } } }