public virtual void Encode(ulong v, StringBuilder sb) { // by default, we just treat a 64-bit group as a sequence of bytes. var bytes = BitConverter.GetBytes(v.ByteSwap()); Encode(bytes, 0, bytes.Length, sb); }
public BigInt(ulong v) { var x = v.ByteSwap(); this._num = new[] { (uint)(x >> 32), (uint)x }; this._byteCount = 8; }
public static ulong NetworkToHostOrder(this ulong value) { if (BitConverter.IsLittleEndian) { return(value.ByteSwap()); } return(value); }
public static void Write(this BinaryWriter writer, ulong value, bool isLittleEndian) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write(!isLittleEndian ? value.ByteSwap() : value); }
public static ulong ReadUInt64(this BinaryReader reader, bool isLittleEndian) { if (reader == null) { throw new ArgumentNullException("reader"); } ulong value = reader.ReadUInt64(); return(!isLittleEndian?value.ByteSwap() : value); }