Пример #1
0
        internal static void StaticRead(BitcoinStream bs, ref byte[] bytes)
        {
            ulong length = BitcoinInt.StaticRead(bs);

            bytes = new byte[length];
            bs.ReadWrite(ref bytes);
        }
Пример #2
0
 public void ReadWrite(BitcoinStream stream)
 {
     if (stream.Serializing)
     {
         BitcoinInt.StaticWrite(stream, this._wartosc);
     }
     else
     {
         this._wartosc = BitcoinInt.StaticRead(stream);
     }
 }
Пример #3
0
        internal static void StaticWrite(BitcoinStream bs, byte[] bytes)
        {
            ulong length = bytes == null ? 0UL : (ulong)bytes.Length;

            BitcoinInt.StaticWrite(bs, length);
            if (bytes == null)
            {
                return;
            }
            bs.ReadWrite(ref bytes);
        }
Пример #4
0
        public void ReadWrite(BitcoinStream stream)
        {
            BitcoinInt data = new BitcoinInt((ulong)this._bytes.Length);

            stream.ReadWrite <BitcoinInt>(ref data);
            if (!stream.Serializing)
            {
                this._bytes = new byte[data.ToLong()];
            }

            stream.ReadWrite(ref this._bytes);
        }