/// <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> public void WriteToBytes(byte [] data) { LittleEndian.PutLong(data, _offset, _value); }
/// <summary> /// set the value from its offset into an array of bytes /// </summary> /// <param name="data">the byte array from which the value is to be read</param> public void ReadFromBytes(byte [] data) { _value = LittleEndian.GetLong(data, _offset); }
/// <summary> /// set the value from an Stream /// </summary> /// <param name="stream">the Stream from which the value is to be</param> public void ReadFromStream(Stream stream) { _value = LittleEndian.ReadLong(stream); }
/// <summary> /// Same as using the constructor <see cref="LongField"/> 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, long value, byte[] data) { LittleEndian.PutLong(data, offset, value); }