public void ReadWrite(BitcoinStream stream) { var len = new VarInt((ulong)_Bytes.Length); stream.ReadWrite(ref len); if(!stream.Serializing) { if(len.ToLong() > (uint)stream.MaxArraySize) throw new ArgumentOutOfRangeException("Array size not big"); _Bytes = new byte[len.ToLong()]; } stream.ReadWrite(ref _Bytes); }
public void ReadWrite(BitcoinStream stream) { var len = new VarInt((ulong)_Bytes.Length); stream.ReadWrite(ref len); if (!stream.Serializing) { if (len.ToLong() > (uint)stream.MaxArraySize) { throw new ArgumentOutOfRangeException("Array size not big"); } _Bytes = new byte[len.ToLong()]; } stream.ReadWrite(ref _Bytes); }
public void ReadWrite(BitcoinStream stream) { stream.ReadWrite(ref _Header); VarInt txCount = new VarInt(0); stream.ReadWrite(ref txCount); }
internal static void StaticWrite(BitcoinStream bs, byte[] bytes) { VarInt.StaticWrite(bs, (ulong)bytes.Length); bs.ReadWrite(ref bytes); }