public void add(BytesRef utf8, int bucket) throws IOException {if (bucket < 0 || bucket >= buckets) {throw new IllegalArgumentException("Bucket outside of the allowed range [0, " + buckets + "): " + bucket);}scratch.grow(utf8.length + 10);scratch.clear();scratch.append((byte) bucket);scratch.append(utf8);sorter.add(scratch.get());}
public virtual void Add(BytesRef utf8, int bucket){if (bucket < 0 || bucket >= buckets){throw new ArgumentException("Bucket outside of the allowed range [0, " + buckets + "): " + bucket);}if (scratch.Bytes.Length < utf8.Length + 1){scratch.Grow(utf8.Length + 10);}scratch.Length = 1;scratch.Bytes[0] = (byte)bucket;scratch.Append(utf8);sorter.Add(scratch);}