当前位置: 首页>>代码示例>>Java>>正文


Java ShortByReference类代码示例

本文整理汇总了Java中com.sun.jna.ptr.ShortByReference的典型用法代码示例。如果您正苦于以下问题:Java ShortByReference类的具体用法?Java ShortByReference怎么用?Java ShortByReference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShortByReference类属于com.sun.jna.ptr包,在下文中一共展示了ShortByReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
/**
 * Retrieves a message from a message queue, provided the queue is not in a QUIT state.
 * The message will be stored in the buffer specified in the Buffer argument.<br>
 * Note: The error code {@link INotesErrorConstants#ERR_MQ_QUITTING} indicates that the
 * message queue is in the QUIT state, denoting that applications that are reading
 * the message queue should terminate. For instance, a server addin's message queue
 * will be placed in the QUIT state when a "tell &lt;addin&gt; quit" command is input at the console.

 * @param buffer buffer used to read data
 * @param waitForMessage if the specified message queue is empty, wait for a message to appear in the queue. The timeout argument specifies the amount of time to wait for a message.
 * @param timeoutMillis if waitForMessage is set to <code>true</code>, the number of milliseconds to wait for a message before timing out. Specify 0 to wait forever. If the message queue goes into a QUIT state before the Timeout expires, MQGet will return immediately.
 * @param offset the offset in the buffer where to start writing the message
 * @param length the max length of the message in the buffer
 * @return Number of bytes written to the buffer
 */
public int get(Memory buffer, boolean waitForMessage, int timeoutMillis, int offset, int length) {
	checkHandle();

	if (length > NotesConstants.MQ_MAX_MSGSIZE) {
		throw new IllegalArgumentException("Max size for the buffer is "+NotesConstants.MQ_MAX_MSGSIZE+" bytes. You specified one with "+length+" bytes.");
	}

	ShortByReference retMsgLength = new ShortByReference();

	short result = NotesNativeAPI.get().MQGet(m_queue, buffer, (short) (length & 0xffff),
			waitForMessage ? NotesConstants.MQ_WAIT_FOR_MSG : 0,
					timeoutMillis, retMsgLength);
	NotesErrorUtils.checkResult(result);
	return retMsgLength.getValue();
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:31,代码来源:MessageQueue.java

示例2: getCollation

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
/**
 * Returns the currently active collation
 * 
 * @return collation
 */
private short getCollation() {
	checkHandle();
	short result;
	ShortByReference retCollationNum = new ShortByReference();
	
	if (PlatformUtils.is64Bit()) {
		result = NotesNativeAPI64.get().NIFGetCollation(m_hCollection64, retCollationNum);
	}
	else {
		result = NotesNativeAPI32.get().NIFGetCollation(m_hCollection32, retCollationNum);
	}
	NotesErrorUtils.checkResult(result);
	return retCollationNum.getValue();
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:20,代码来源:NotesCollection.java

示例3: toCanonicalName

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
/**
 * This function converts a distinguished name in abbreviated format to canonical format.
 * A fully distinguished name is in canonical format - it contains all possible naming components.
 * The abbreviated format of a distinguished name removes the labels from the naming components.
 * 
 * @param name name to convert
 * @param templateName name to be used when the input name is in common name format
 * @return canonical name
 */
public static String toCanonicalName(String name, String templateName) {
	if (name==null)
		return null;
	if (name.length()==0)
		return name;

	String cacheKey = name + ((templateName!=null && templateName.length()>0) ? ("|" + templateName) : "");
	String abbrName = m_nameCanonicalCache.get(cacheKey);
	if (abbrName!=null) {
		return abbrName;
	}

	Memory templateNameMem = templateName==null ? null : NotesStringUtils.toLMBCS(templateName, true); //used when abbrName is only a common name
	Memory inNameMem = NotesStringUtils.toLMBCS(name, true);
	Memory outNameMem = new Memory(NotesConstants.MAXUSERNAME);
	ShortByReference outLength = new ShortByReference();
	
	short result = NotesNativeAPI.get().DNCanonicalize(0, templateNameMem, inNameMem, outNameMem, NotesConstants.MAXUSERNAME, outLength);
	NotesErrorUtils.checkResult(result);
	
	String sOutName = NotesStringUtils.fromLMBCS(outNameMem, (int) (outLength.getValue() & 0xffff));
	
	m_nameCanonicalCache.put(cacheKey, sOutName);
	
	return sOutName;
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:36,代码来源:NotesNamingUtils.java

示例4: toAbbreviatedName

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
/**
 * This function converts a distinguished name in canonical format to abbreviated format.
 * A fully distinguished name is in canonical format - it contains all possible naming components.
 * The abbreviated format of a distinguished name removes the labels from the naming components.
 * 
 * @param name name to convert
 * @param templateName name to be used when the input name is in common name format
 * @return abbreviated name
 */
public static String toAbbreviatedName(String name, String templateName) {
	if (name==null)
		return null;
	if (name.length()==0)
		return name;
	
	String cacheKey = name + ((templateName!=null && templateName.length()>0) ? ("|" + templateName) : "");
	String abbrName = m_nameAbbrCache.get(cacheKey);
	if (abbrName!=null) {
		return abbrName;
	}
	
	Memory templateNameMem = templateName==null || templateName.length()==0 ? null : NotesStringUtils.toLMBCS(templateName, true); //used when abbrName is only a common name
	Memory inNameMem = NotesStringUtils.toLMBCS(name, true);
	Memory outNameMem = new Memory(NotesConstants.MAXUSERNAME);
	ShortByReference outLength = new ShortByReference();
	
	short result = NotesNativeAPI.get().DNAbbreviate(0, templateNameMem, inNameMem, outNameMem, NotesConstants.MAXUSERNAME, outLength);
	NotesErrorUtils.checkResult(result);
	
	String sOutName = NotesStringUtils.fromLMBCS(outNameMem, (int) (outLength.getValue() & 0xffff));
	
	m_nameAbbrCache.put(cacheKey, sOutName);
	
	return sOutName;
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:36,代码来源:NotesNamingUtils.java

示例5: ListAllocate

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short ListAllocate(
short ListEntries,
short TextSize,
int fPrefixDataType,
LongByReference rethList,
Memory retpList,
ShortByReference retListSize);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:INotesNativeAPI64.java

示例6: NSFItemInfo

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFItemInfo(
long note_handle,
Memory item_name,
short  name_len,
NotesBlockIdStruct retbhItem,
ShortByReference retDataType,
NotesBlockIdStruct retbhValue,
IntByReference retValueLength);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:9,代码来源:INotesNativeAPI64.java

示例7: NSFItemInfoNext

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFItemInfoNext(
long  note_handle,
NotesBlockIdStruct.ByValue NextItem,
Memory item_name,
short  name_len,
NotesBlockIdStruct retbhItem,
ShortByReference retDataType,
NotesBlockIdStruct retbhValue,
IntByReference retValueLength);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:10,代码来源:INotesNativeAPI64.java

示例8: NSFItemInfoPrev

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFItemInfoPrev(
long  note_handle,
NotesBlockIdStruct.ByValue  CurrItem,
Memory item_name,
short  name_len,
NotesBlockIdStruct item_blockid_ptr,
ShortByReference value_type_ptr,
NotesBlockIdStruct value_blockid_ptr,
IntByReference value_len_ptr);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:10,代码来源:INotesNativeAPI64.java

示例9: NSFDbGetNoteInfoExt

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFDbGetNoteInfoExt(
long  hDB,
int  NoteID,
NotesOriginatorIdStruct retNoteOID,
NotesTimeDateStruct retModified,
ShortByReference retNoteClass,
NotesTimeDateStruct retAddedToFile,
ShortByReference retResponseCount,
IntByReference retParentNoteID);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:10,代码来源:INotesNativeAPI64.java

示例10: NSFComputeEvaluate

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public native short NSFComputeEvaluate(
long  hCompute,
long hNote,
LongByReference rethResult,
ShortByReference retResultLength,
IntByReference retNoteMatchesFormula,
IntByReference retNoteShouldBeDeleted,
IntByReference retNoteModified);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:9,代码来源:NotesNativeAPI64.java

示例11: NSFDbGetObjectSize

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFDbGetObjectSize(
long hDB,
int ObjectID,
short ObjectType,
IntByReference retSize,
ShortByReference retClass,
ShortByReference retPrivileges);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:INotesNativeAPI64.java

示例12: NIFReadEntriesExt

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NIFReadEntriesExt(long hCollection,
NotesCollectionPositionStruct CollectionPos,
         short SkipNavigator, int SkipCount,
         short ReturnNavigator, int ReturnCount, int ReturnMask,
         NotesTimeDateStruct DiffTime, long DiffIDTable, int ColumnNumber, int Flags,
         LongByReference rethBuffer, ShortByReference retBufferLength,
         IntByReference retNumEntriesSkipped, IntByReference retNumEntriesReturned,
         ShortByReference retSignalFlags, NotesTimeDateStruct retDiffTime,
         NotesTimeDateStruct retModifiedTime, IntByReference retSequence);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:10,代码来源:INotesNativeAPI64.java

示例13: NIFFindByKeyExtended3

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public long NIFFindByKeyExtended3 (long hCollection,
Memory keyBuffer, int findFlags,
int returnFlags,
NotesCollectionPositionStruct retIndexPos,
IntByReference retNumMatches, ShortByReference retSignalFlags,
LongByReference rethBuffer, IntByReference retSequence,
NotesCallbacks.NIFFindByKeyProc NIFFindByKeyCallback, NIFFindByKeyContextStruct Ctx);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:INotesNativeAPI64.java

示例14: ACLLookupAccess

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public native short ACLLookupAccess(
long hACL,
Pointer pNamesList,
ShortByReference retAccessLevel,
Memory retPrivileges,
ShortByReference retAccessFlags,
LongByReference rethPrivNames);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:NotesNativeAPI64.java

示例15: NSFFormulaCompile

import com.sun.jna.ptr.ShortByReference; //导入依赖的package包/类
public short NSFFormulaCompile(
Memory FormulaName,
short FormulaNameLength,
Memory FormulaText,
short  FormulaTextLength,
LongByReference rethFormula,
ShortByReference retFormulaLength,
ShortByReference retCompileError,
ShortByReference retCompileErrorLine,
ShortByReference retCompileErrorColumn,
ShortByReference retCompileErrorOffset,
ShortByReference retCompileErrorLength);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:13,代码来源:INotesNativeAPI64.java


注:本文中的com.sun.jna.ptr.ShortByReference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。