com.sun.jna.ptr.LongByReference Java Examples

The following examples show how to use com.sun.jna.ptr.LongByReference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LiveViewLogicDefault.java    From canon-sdk-java with MIT License 6 votes vote down vote up
@Override
public byte[] getLiveViewImageBuffer(final EdsCameraRef camera) {
    try (final LiveViewReference liveViewImageReference = getLiveViewImageReference(camera)) {

        final LongByReference length = new LongByReference();
        final EdsdkError error = toEdsdkError(edsdkLibrary().EdsGetLength(liveViewImageReference.getStreamRef().getValue(), length));
        if (error != EdsdkError.EDS_ERR_OK) {
            throw error.getException();
        }

        final PointerByReference dataRef = new PointerByReference();
        final EdsdkError dataError = toEdsdkError(edsdkLibrary().EdsGetPointer(liveViewImageReference.getStreamRef().getValue(), dataRef));
        if (dataError != EdsdkError.EDS_ERR_OK) {
            throw dataError.getException();
        }
        return dataRef.getValue().getByteArray(0, (int) length.getValue());
    }
}
 
Example #2
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short Schedule_ExtractMoreSchedList(
long hCntnr,
int hMoreCtx,
NotesTimeDatePairStruct pInterval,
IntByReference retdwSize,
LongByReference rethSchedList,
IntByReference rethMore);
 
Example #3
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short Schedule_ExtractBusyTimeRange(
long hCntnr,
int hSchedObj,
NotesUniversalNoteIdStruct punidIgnore,
NotesTimeDatePairStruct pInterval,
IntByReference retdwSize,
LongByReference rethRange,
IntByReference rethMoreCtx);
 
Example #4
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short Schedule_ExtractMoreBusyTimeRange(
long hCntnr,
int hMoreCtx,
NotesUniversalNoteIdStruct punidIgnore,
NotesTimeDatePairStruct pInterval,
IntByReference retdwSize,
LongByReference rethRange,
IntByReference rethMore);
 
Example #5
Source File: NotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public native short NSFDbGetMultNoteInfo(
long  hDb,
short  Count,
short  Options,
long  hInBuf,
IntByReference retSize,
LongByReference rethOutBuf);
 
Example #6
Source File: NotesNativeAPI32.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public native short NSFNoteCipherDecrypt(
int  hNote,
int hKFC,
int  DecryptFlags,
LongByReference rethCipherForAttachments,
int  Reserved,
Pointer pReserved);
 
Example #7
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NSFMimePartCreateStream(
long hNote,
Memory pchItemName,
short wItemNameLen,
short wPartType,
int dwFlags,
LongByReference phCtx);
 
Example #8
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NSFNoteOpenWithLock(
long hDB,
int NoteID,
int LockFlags,
int OpenFlags,
Memory pLockers,
LongByReference rethLockers,
IntByReference retLength,
LongByReference rethNote);
 
Example #9
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short Schedule_ExtractFreeTimeRange(
long hCntnr,
int hSchedObj,
NotesUniversalNoteIdStruct punidIgnore,
short fFindFirstFit,
short wDuration,
NotesTimeDatePairStruct pInterval,
IntByReference retdwSize,
LongByReference rethRange);
 
Example #10
Source File: JnaBlob.java    From jaybird with GNU Lesser General Public License v2.1 5 votes vote down vote up
public JnaBlob(JnaDatabase database, JnaTransaction transaction, BlobParameterBuffer blobParameterBuffer,
        long blobId) {
    super(database, transaction, blobParameterBuffer);
    this.blobId = new LongByReference(blobId);
    outputBlob = blobId == NO_BLOB_ID;
    clientLibrary = database.getClientLibrary();
}
 
Example #11
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NIFOpenCollectionWithUserNameList (long hViewDB, long hDataDB,
int ViewNoteID, short OpenFlags,
long hUnreadList,
LongByReference rethCollection,
LongByReference rethViewNote, Memory retViewUNID,
LongByReference rethCollapsedList,
LongByReference rethSelectedList,
long nameList);
 
Example #12
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short FTSearch(
long hDB,
LongByReference phSearch,
long hColl,
Memory query,
int options,
short  limit,
long hIDTable,
IntByReference retNumDocs,
Memory reserved,
LongByReference rethResults);
 
Example #13
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short CalGetUnappliedNotices(
long hDB,
Memory pszUID,
ShortByReference pwNumNotices,
LongByReference phRetNOTEIDs,
LongByReference phRetUNIDs,
Pointer pReserved,
int dwFlags,
Pointer pCtx);
 
Example #14
Source File: SECP256K1.java    From besu with Apache License 2.0 5 votes vote down vote up
private static Optional<PublicKey> recoverFromSignatureNative(
    final Bytes32 dataHash, final Signature signature) {

  // parse the sig
  final LibSecp256k1.secp256k1_ecdsa_recoverable_signature parsedSignature =
      new LibSecp256k1.secp256k1_ecdsa_recoverable_signature();
  final Bytes encodedSig = signature.encodedBytes();
  if (LibSecp256k1.secp256k1_ecdsa_recoverable_signature_parse_compact(
          LibSecp256k1.CONTEXT,
          parsedSignature,
          encodedSig.slice(0, 64).toArrayUnsafe(),
          encodedSig.get(64))
      == 0) {
    throw new IllegalArgumentException("Could not parse signature");
  }

  // recover the key
  final LibSecp256k1.secp256k1_pubkey newPubKey = new LibSecp256k1.secp256k1_pubkey();
  if (LibSecp256k1.secp256k1_ecdsa_recover(
          LibSecp256k1.CONTEXT, newPubKey, parsedSignature, dataHash.toArrayUnsafe())
      == 0) {
    throw new IllegalArgumentException("Could not recover public key");
  }

  // parse the key
  final ByteBuffer recoveredKey = ByteBuffer.allocate(65);
  final LongByReference keySize = new LongByReference(recoveredKey.limit());
  LibSecp256k1.secp256k1_ec_pubkey_serialize(
      LibSecp256k1.CONTEXT, recoveredKey, keySize, newPubKey, SECP256K1_EC_UNCOMPRESSED);

  return Optional.of(PublicKey.create(Bytes.wrapByteBuffer(recoveredKey).slice(1)));
}
 
Example #15
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short SchSrvRetrieveExt(
Pointer pClientNames,
NotesUniversalNoteIdStruct pApptUnid,
NotesTimeDateStruct pApptOrigDate,
int dwOptions,
NotesTimeDatePairStruct pInterval,
Pointer pNames,
Pointer pDetails,
Pointer piCalList,
Memory pszProxyUserName,
Memory pszProxyPassword,
LongByReference rethCntnr);
 
Example #16
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short SECTokenGenerate(
Memory ServerName,
Memory OrgName,
Memory ConfigName,
Memory UserName,
NotesTimeDateStruct Creation,
NotesTimeDateStruct Expiration,
LongByReference retmhToken,
int dwReserved,
Pointer vpReserved);
 
Example #17
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NSFDbCreateAndCopyExtended(
Memory srcDb,
Memory dstDb,
short NoteClass,
short limit,
int flags,
long hNames,
LongByReference hNewDb);
 
Example #18
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NSFGetFolderChanges(
long hViewDB,
long hDataDB,
int viewNoteID,
NotesTimeDateStruct since,
int Flags,
LongByReference addedNoteTable,
LongByReference removedNoteTable);
 
Example #19
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short ACLLookupAccess(
long hACL,
Pointer pNamesList,
ShortByReference retAccessLevel,
Memory retPrivileges,
ShortByReference retAccessFlags,
LongByReference rethPrivNames);
 
Example #20
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short NSFDbOpenTemplateExtended(
Memory PathName,
short Options,
long hNames,
NotesTimeDateStruct ModifiedTime,
LongByReference rethDB,
NotesTimeDateStruct retDataModified,
NotesTimeDateStruct retNonDataModified);
 
Example #21
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public short MIMEGetEntityData(
long hNote,
Pointer pME,
short wDataType,
int dwOffset,
int dwRetBytes,
LongByReference phData,
IntByReference pdwDataLen);
 
Example #22
Source File: NotesNativeAPI64.java    From domino-jna with Apache License 2.0 5 votes vote down vote up
public native short NSFComputeEvaluate(
long  hCompute,
long hNote,
LongByReference rethResult,
ShortByReference retResultLength,
IntByReference retNoteMatchesFormula,
IntByReference retNoteShouldBeDeleted,
IntByReference retNoteModified);
 
Example #23
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
public short NIFReadEntries(long hCollection, NotesCollectionPositionStruct IndexPos, short SkipNavigator, int SkipCount, short ReturnNavigator, int ReturnCount, int ReturnMask, LongByReference rethBuffer,
ShortByReference retBufferLength, IntByReference retNumEntriesSkipped, IntByReference retNumEntriesReturned, ShortByReference retSignalFlags);
 
Example #24
Source File: NotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
public native short CreateNamesListFromSingleName(Memory pszServerName, short fDontLookupAlternateNames,
Pointer pLookupFlags, Memory pTarget, LongByReference rethNames);
 
Example #25
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
public short NIFOpenCollection(long hViewDB, long hDataDB, int ViewNoteID, short OpenFlags, long hUnreadList, LongByReference rethCollection, LongByReference rethViewNote, Memory retViewUNID,
LongByReference rethCollapsedList, LongByReference rethSelectedList);
 
Example #26
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
public short NSPingServer(
Memory pServerName,
IntByReference pdwIndex,
LongByReference phList);
 
Example #27
Source File: NotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
@Override
public native short NSFNoteCreateClone(long hSrcNote, LongByReference rethDstNote);
 
Example #28
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
@UndocumentedAPI
public short CreateNamesListUsingLookupName(Memory pszServerName,Pointer pLookupFlags, Memory pTarget,
		LongByReference rethNames);
 
Example #29
Source File: INotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
@UndocumentedAPI
public short CreateNamesListFromNamesExtend(Memory pszServerName, short cTargets, Pointer ptrArrTargets, LongByReference rethNames);
 
Example #30
Source File: NotesNativeAPI64.java    From domino-jna with Apache License 2.0 4 votes vote down vote up
public native short CompoundTextClose(
long hCompound,
LongByReference phReturnBuffer,
IntByReference pdwReturnBufferSize,
Memory pchReturnFile,
short wReturnFileNameSize);