text: public static BytesRef ToBytesRef(Int32sRef input, BytesRef scratch){scratch.Grow(input.Length);for (int i = 0; i < input.Length; i++){int value = input.Int32s[i + input.Offset];Debug.Assert(value >= sbyte.MinValue && value <= 255, "value " + value + " doesn't fit into byte");scratch.Bytes[i] = (byte)value;}scratch.Length = input.Length;return scratch;}