1 7 8 package javax.naming.ldap; 9 10 import java.io.IOException ; 11 import com.sun.jndi.ldap.Ber; 12 import com.sun.jndi.ldap.BerDecoder; 13 14 43 final public class PagedResultsResponseControl extends BasicControl { 44 45 49 public static final String OID = "1.2.840.113556.1.4.319"; 50 51 private static final long serialVersionUID = -8819778744844514666L; 52 53 58 private int resultSize; 59 60 65 private byte[] cookie; 66 67 78 public PagedResultsResponseControl(String id, boolean criticality, 79 byte[] value) throws IOException { 80 81 super(id, criticality, value); 82 83 BerDecoder ber = new BerDecoder(value, 0, value.length); 85 86 ber.parseSeq(null); 87 resultSize = ber.parseInt(); 88 cookie = ber.parseOctetString(Ber.ASN_OCTET_STR, null); 89 } 90 91 96 public int getResultSize() { 97 return resultSize; 98 } 99 100 108 public byte[] getCookie() { 109 if (cookie.length == 0) { 110 return null; 111 } else { 112 return cookie; 113 } 114 } 115 } 116 | Popular Tags |