Home | History | Annotate | Download | only in util

Lines Matching refs:length

237         int length=remainingMatchLength_;  // Actual remaining match length minus 1.
238 if(length>=0) {
241 remainingMatchLength_=--length;
244 return (length<0 && (node=bytes_[pos]&0xff)>=kMinValueLead) ?
279 int length=remainingMatchLength_; // Actual remaining match length minus 1.
286 remainingMatchLength_=length;
289 return (length<0 && (node=(bytes_[pos]&0xff))>=kMinValueLead) ?
293 if(length<0) {
294 remainingMatchLength_=length;
302 --length;
323 // Match length+1 bytes.
324 length=node-kMinLinearMatch; // Actual match length minus 1.
330 --length;
434 * Otherwise, the iterator returns strings with this maximum length.
447 * Otherwise, the iterator returns strings with this maximum length.
465 * @return The length of the byte sequence.
468 public int bytesLength() { return length; }
483 System.arraycopy(bytes, 0, dest, destOffset, length);
490 return ByteBuffer.wrap(bytes, 0, length).asReadOnlyBuffer();
500 if(bytes.length<len) {
501 byte[] newBytes=new byte[Math.min(2*bytes.length, 2*len)];
502 System.arraycopy(bytes, 0, newBytes, 0, length);
507 ensureCapacity(length+1);
508 bytes[length++]=b;
511 ensureCapacity(length+len);
512 System.arraycopy(b, off, bytes, length, len);
513 length+=len;
515 private void truncateString(int newLength) { length=newLength; }
518 private int length;
532 int length=remainingMatchLength_; // Actual remaining match length minus 1.
533 if(length>=0) {
535 ++length;
536 if(maxLength_>0 && length>maxLength_) {
537 length=maxLength_; // This will leave remainingMatchLength>=0 as a signal.
539 entry_.append(bytes_, pos_, length);
540 pos_+=length;
541 remainingMatchLength_-=length;
553 int length=remainingMatchLength_+1; // Remaining match length.
554 if(maxLength_>0 && length>maxLength_) {
555 length=maxLength_;
557 entry_.truncateString(length);
558 pos_+=length;
559 remainingMatchLength_-=length;
574 * If the byte sequence is truncated to the maximum length and does not
592 int length=(int)top;
594 entry_.truncateString(length&0xffff);
595 length>>>=16;
596 if(length>1) {
597 pos=branchNext(pos, length);
616 if(isFinal || (maxLength_>0 && entry_.length==maxLength_)) {
623 if(maxLength_>0 && entry_.length==maxLength_) {
635 // Linear-match node, append length bytes to entry_.
636 int length=node-kMinLinearMatch+1;
637 if(maxLength_>0 && entry_.length+length>maxLength_) {
638 entry_.append(bytes_, pos, maxLength_-entry_.length);
641 entry_.append(bytes_, pos, length);
642 pos+=length;
663 private int branchNext(int pos, int length) {
664 while(length>kMaxBranchLinearSubNodeLength) {
667 stack_.add(((long)skipDelta(bytes_, pos)<<32)|((length-(length>>1))<<16)|entry_.length);
669 length>>=1;
679 stack_.add(((long)pos<<32)|((length-1)<<16)|entry_.length);
703 // and the remaining branch length in bits 24..16. (Bits 31..25 are unused.)
704 // (We could store the remaining branch length minus 1 in bits 23..16 and not use bits 31..24,
785 private Result branchNext(int pos, int length, int inByte) {
787 if(length==0) {
788 length=bytes_[pos++]&0xff;
790 ++length;
791 // The length of the branch is the number of bytes to select from.
793 while(length>kMaxBranchLinearSubNodeLength) {
795 length>>=1;
798 length=length-(length>>1);
803 // length>=2 because the loop body above sees length>kMaxBranchLinearSubNodeLength>=3
804 // and divides length by 2.
841 --length;
843 } while(length>1);
861 // Match the first of length+1 bytes.
862 int length=node-kMinLinearMatch; // Actual match length minus 1.
864 remainingMatchLength_=--length;
866 return (length<0 && (node=bytes_[pos]&0xff)>=kMinValueLead) ?
891 private static long findUniqueValueFromBranch(byte[] bytes, int pos, int length,
893 while(length>kMaxBranchLinearSubNodeLength) {
895 uniqueValue=findUniqueValueFromBranch(bytes, jumpByDelta(bytes, pos), length>>1, uniqueValue);
899 length=length-(length>>1);
923 } while(--length>1);
966 private static void getNextBranchBytes(byte[] bytes, int pos, int length, Appendable out) {
967 while(length>kMaxBranchLinearSubNodeLength) {
969 getNextBranchBytes(bytes, jumpByDelta(bytes, pos), length>>1, out);
970 length=length-(length>>1);
976 } while(--length>1);
997 // - Value node: Stores a 32-bit integer in a compact, variable-length format.
1003 // The node byte is the length of the branch (number of bytes to select from)
1005 // - If the length is at most kMaxBranchLinearSubNodeLength, then
1006 // there are length-1 (key, value) pairs and then one more comparison byte.
1011 // - If the length is greater than kMaxBranchLinearSubNodeLength, then
1014 // the next sub-node which will have a length of length/2.
1017 // which will have a length of length-length/2.
1021 // 00..0f: Branch node. If node!=0 then the length is node+1, otherwise
1022 // the length is one more than the next byte.
1032 // 20..ff: Variable-length value node.
1074 // Remaining length of a linear-match node, minus 1. Negative if not in such a node.