public void fillSlice(BytesRef b, long start, int length) {assert length >= 0: "length=" + length;assert length <= blockSize+1: "length=" + length;b.length = length;if (length == 0) {return;}final int index = (int) (start >> blockBits);final int offset = (int) (start & blockMask);if (blockSize - offset >= length) {b.bytes = blocks[index];b.offset = offset;} else {b.bytes = new byte[length];b.offset = 0;System.arraycopy(blocks[index], offset, b.bytes, 0, blockSize-offset);System.arraycopy(blocks[1+index], 0, b.bytes, blockSize-offset, length-(blockSize-offset));}}

public void FillSlice(BytesRef b, long start, int length){Debug.Assert(length >= 0, "length=" + length);Debug.Assert(length <= blockSize + 1, "length=" + length);b.Length = length;if (length == 0){return;}var index = (int)(start >> blockBits);var offset = (int)(start & blockMask);if (blockSize - offset >= length){b.Bytes = blocks[index];b.Offset = offset;}else{b.Bytes = new byte[length];b.Offset = 0;Array.Copy(blocks[index], offset, b.Bytes, 0, blockSize - offset);Array.Copy(blocks[1 + index], 0, b.Bytes, blockSize - offset, length - (blockSize - offset));}}
