/// <summary> /// Same as using the constructor <see cref="ShortField"/> with the same /// parameter list. Avoid creation of an useless object. /// </summary> /// <param name="offset">offset of the field within its byte array</param> /// <param name="value">the initial value</param> /// <param name="data">the byte array to write the value to</param> public static void Write(int offset, short value, ref byte[] data) { LittleEndian.PutShort(data, offset, value); }
/// <summary> /// write the value out to an array of bytes at the appropriate /// offset /// </summary> /// <param name="data">the array of bytes to which the value is to be /// written</param> /// <exception cref="IndexOutOfRangeException">if the offset is out /// of range</exception> public void WriteToBytes(byte [] data) { LittleEndian.PutShort(data, _offset, _value); }