public BytesRef add(BytesRef prefix, BytesRef output) {assert prefix != null;assert output != null;if (prefix == NO_OUTPUT) {return output;} else if (output == NO_OUTPUT) {return prefix;} else {assert prefix.length > 0;assert output.length > 0;BytesRef result = new BytesRef(prefix.length + output.length);System.arraycopy(prefix.bytes, prefix.offset, result.bytes, 0, prefix.length);System.arraycopy(output.bytes, output.offset, result.bytes, prefix.length, output.length);result.length = prefix.length + output.length;return result;}}

public BytesRef add ( BytesRef prefix , BytesRef output ) { assert prefix != null ; assert output != null ; if ( prefix == NO_OUTPUT ) { return output ; } else if ( output == NO_OUTPUT ) { return prefix ; } else { assert prefix . length > 0 ; assert output . length > 0 ; BytesRef result = new BytesRef ( prefix . length + output . length ) ; System . arraycopy ( prefix . bytes , prefix . offset , result . bytes , 0 , prefix . length ) ; System . arraycopy ( output . bytes , output . offset , result . bytes , prefix . length , output . length ) ; result . length = prefix . length + output . length ; return result ; } }
public override BytesRef Add(BytesRef prefix, BytesRef output){Debug.Assert(prefix != null);Debug.Assert(output != null);if (prefix == NO_OUTPUT){return output;}else if (output == NO_OUTPUT){return prefix;}else{Debug.Assert(prefix.Length > 0);Debug.Assert(output.Length > 0);BytesRef result = new BytesRef(prefix.Length + output.Length);Array.Copy(prefix.Bytes, prefix.Offset, result.Bytes, 0, prefix.Length);Array.Copy(output.Bytes, output.Offset, result.Bytes, prefix.Length, output.Length);result.Length = prefix.Length + output.Length;return result;}}
