void (int[] I, byte[] oldBuf) { int oldSize = oldBuf.length; int[] V = new int[oldSize + 1]; int[] buckets = new int[256]; int i, h, len; for (i = 0; i < 256; i++) { buckets[i] = 0; } for (i = 0; i < oldSize; i++) { buckets[(int)oldBuf[i] & 0xff]++; } for (i = 1; i < 256; i++) { buckets[i] += buckets[i - 1]; } for (i = 255; i > 0; i--) { buckets[i] = buckets[i - 1]; } buckets[0] = 0; for (i = 0; i < oldSize; i++) { I[++buckets[(int)oldBuf[i] & 0xff]] = i; } I[0] = oldSize; for (i = 0; i < oldSize; i++) { V[i] = buckets[(int)oldBuf[i] & 0xff]; } V[oldSize] = 0; for (i = 1; i < 256; i++) { if (buckets[i] == buckets[i - 1] + 1) { I[buckets[i]] = -1; } } I[0] = -1; for (h = 1; I[0] != -(oldSize + 1); h += h) { len = 0; for (i = 0; i < oldSize + 1;) { if (I[i] < 0) { len -= I[i]; i -= I[i]; } else { if (len != 0) { I[i - len] = -len; } len = V[I[i]] + 1 - i; split(I, V, i, len, h); i += len; len = 0; } } if (len != 0) { I[i - len] = -len; } } for (i = 0; i < oldSize + 1; i++) { I[V[i]] = i; } //noinspection UnusedAssignment V = null; }