BitSharper.Utils.Uint64ToByteStreamLe C# (CSharp) 메소드

Uint64ToByteStreamLe() 공개 정적인 메소드

public static Uint64ToByteStreamLe ( ulong val, Stream stream ) : void
val ulong
stream Stream
리턴 void
        public static void Uint64ToByteStreamLe(ulong val, Stream stream)
        {
            var bytes = BitConverter.GetBytes(val);
            if (!BitConverter.IsLittleEndian)
            {
                Array.Reverse(bytes);
            }
            stream.Write(bytes);
        }

Usage Example

예제 #1
0
 /// <exception cref="IOException"/>
 public override void BitcoinSerializeToStream(Stream stream)
 {
     Debug.Assert(_scriptBytes != null);
     Utils.Uint64ToByteStreamLe(Value, stream);
     // TODO: Move script serialization into the Script class, where it belongs.
     stream.Write(new VarInt((ulong)_scriptBytes.Length).Encode());
     stream.Write(_scriptBytes);
 }
All Usage Examples Of BitSharper.Utils::Uint64ToByteStreamLe