Пример #1
0
            public Raw(byte[] data)
            {
                var str = new VarString();

                str.FromBytes(data);
                _Data = str.GetString(true);
            }
Пример #2
0
        public void ReadWriteAsVarString(ref byte[] bytes)
        {
            VarString str = new VarString(bytes);

            ReadWrite(ref str);
            bytes = str.GetString();
        }
Пример #3
0
 public void ReadWriteAsVarString(ref byte[] bytes)
 {
     if (Serializing)
     {
         VarString.StaticWrite(this, bytes);
     }
     else
     {
         VarString.StaticRead(this, ref bytes);
     }
 }
Пример #4
0
 public void ReadWriteAsVarString(ref byte[] bytes)
 {
     if (Serializing)
     {
         VarString str = new VarString(bytes);
         str.ReadWrite(this);
     }
     else
     {
         VarString str = new VarString();
         str.ReadWrite(this);
         bytes = str.GetString(true);
     }
 }
Пример #5
0
        public Script ReadWrite(Script data)
        {
            if (this.Serializing)
            {
                var bytes = data == null?Script.Empty.ToBytes(true) : data.ToBytes(true);

                ReadWriteAsVarString(ref bytes);
                return(data);
            }

            var varString = new VarString();

            varString.ReadWrite(this);
            return(Script.FromBytesUnsafe(varString.GetString(true)));
        }
Пример #6
0
        public Script ReadWrite(Script data)
        {
            if (Serializing)
            {
                var bytes = data == null?Script.Empty.ToBytes(true) : data.ToBytes(true);

                ReadWriteAsVarString(ref bytes);
                return(data);
            }
            else
            {
                byte[] bytes = null;
                VarString.StaticRead(this, ref bytes);
                return(Script.FromBytesUnsafe(bytes));
            }
        }
Пример #7
0
        public Script ReadWrite(Script data)
        {
            if (Serializing)
            {
                var bytes = data == null?Script.Empty.ToBytes(true) : data.ToBytes(true);

                ReadWriteAsVarString(ref bytes);
                return(data);
            }
            else
            {
                var varString = new VarString();
                varString.ReadWrite(this);
                return(new Script(varString.GetString()));
            }
        }
Пример #8
0
 public Raw(byte[] data)
 {
     var str = new VarString();
     str.FromBytes(data);
     _Data = str.GetString(true);
 }