public Raw(byte[] data) { var str = new VarString(); str.FromBytes(data); _Data = str.GetString(true); }
public void ReadWriteAsVarString(ref byte[] bytes) { VarString str = new VarString(bytes); ReadWrite(ref str); bytes = str.GetString(); }
public void ReadWriteAsVarString(ref byte[] bytes) { if (Serializing) { VarString.StaticWrite(this, bytes); } else { VarString.StaticRead(this, ref bytes); } }
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); } }
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))); }
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)); } }
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())); } }