Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 /// <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);
 }