本文整理汇总了Java中com.sun.jndi.ldap.BerEncoder类的典型用法代码示例。如果您正苦于以下问题:Java BerEncoder类的具体用法?Java BerEncoder怎么用?Java BerEncoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BerEncoder类属于com.sun.jndi.ldap包,在下文中一共展示了BerEncoder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEncodedValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
private byte[] setEncodedValue(SortKey[] sortKeys) throws IOException {
// build the ASN.1 BER encoding
BerEncoder ber = new BerEncoder(30 * sortKeys.length + 10);
String matchingRule;
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
for (int i = 0; i < sortKeys.length; i++) {
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeString(sortKeys[i].getAttributeID(), true); // v3
if ((matchingRule = sortKeys[i].getMatchingRuleID()) != null) {
ber.encodeString(matchingRule, (Ber.ASN_CONTEXT | 0), true);
}
if (! sortKeys[i].isAscending()) {
ber.encodeBoolean(true, (Ber.ASN_CONTEXT | 1));
}
ber.endSeq();
}
ber.endSeq();
return ber.getTrimmedBuf();
}
示例2: encodeResponseValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
private byte[] encodeResponseValue(int targetPosition, int contentCount,
int virtualListViewResult) throws IOException {
// build the ASN.1 encoding
BerEncoder ber = new BerEncoder(10);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(targetPosition); // list offset for the target entry
ber.encodeInt(contentCount); // server's estimate of the current
// number of entries in the list
ber.encodeInt(virtualListViewResult, Ber.ASN_ENUMERATED);
ber.encodeOctetString(new byte[0], Ber.ASN_OCTET_STR);
ber.endSeq();
return ber.getTrimmedBuf();
}
开发者ID:spring-projects,项目名称:spring-ldap,代码行数:17,代码来源:VirtualListViewControlDirContextProcessorTest.java
示例3: setEncodedValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
private byte[] setEncodedValue(int pageSize, byte[] cookie)
throws IOException {
// build the ASN.1 encoding
BerEncoder ber = new BerEncoder(10 + cookie.length);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(pageSize);
ber.encodeOctetString(cookie, Ber.ASN_OCTET_STR);
ber.endSeq();
return ber.getTrimmedBuf();
}
示例4: encodeValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
private byte[] encodeValue(int sortResult) throws IOException {
// build the ASN.1 encoding
BerEncoder ber = new BerEncoder(10);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(sortResult, Ber.ASN_ENUMERATED);
ber.endSeq();
return ber.getTrimmedBuf();
}
示例5: encodeDirSyncValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
/**
* Encode a value suitable for the DirSyncResponseControl used in a test.
*/
private byte[] encodeDirSyncValue(int pageSize, byte[] cookie)
throws IOException {
// build the ASN.1 encoding
BerEncoder ber = new BerEncoder(10 + cookie.length);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(1); // flag
ber.encodeInt(pageSize); // maxReturnLength
ber.encodeOctetString(cookie, Ber.ASN_OCTET_STR);
ber.endSeq();
return ber.getTrimmedBuf();
}
示例6: encodeValue
import com.sun.jndi.ldap.BerEncoder; //导入依赖的package包/类
private byte[] encodeValue(int pageSize, byte[] cookie)
throws IOException {
// build the ASN.1 encoding
BerEncoder ber = new BerEncoder(10 + cookie.length);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(pageSize);
ber.encodeOctetString(cookie, Ber.ASN_OCTET_STR);
ber.endSeq();
return ber.getTrimmedBuf();
}