text: public void Append(BytesRef bytes){var length = bytes.Length;if (length == 0){return;}int offset = bytes.Offset;int overflow = (length + ByteUpto) - BYTE_BLOCK_SIZE;do{if (overflow <= 0){Array.Copy(bytes.Bytes, offset, buffer, ByteUpto, length);ByteUpto += length;break;}else{int bytesToCopy = length - overflow;if (bytesToCopy > 0){Array.Copy(bytes.Bytes, offset, buffer, ByteUpto, bytesToCopy);offset += bytesToCopy;length -= bytesToCopy;}NextBuffer();overflow = overflow - BYTE_BLOCK_SIZE;}} while (true);}