本文整理汇总了C#中DeserializeContext.ReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# DeserializeContext.ReadBytes方法的具体用法?C# DeserializeContext.ReadBytes怎么用?C# DeserializeContext.ReadBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeserializeContext
的用法示例。
在下文中一共展示了DeserializeContext.ReadBytes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
if (Exception == null)
{
EncryptedCode = context.ReadBytes();
}
}
示例2: Deserialize
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
if (Exception == null)
{
SignChecks = context.ReadObjectList<Signed<SignatureRequestSignCheck>>();
EncryptedSignatureRequest = context.ReadBytes();
}
}
示例3: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
SystemName = context.ReadMultiLanguageString();
WelcomeMessage = context.ReadMultiLanguageString();
Image = context.ReadBytes();
Url = context.ReadString();
UpdateVersion = context.ReadString();
UpdateUrl = context.ReadString();
}
示例4: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
ReceiverId = context.ReadGuid();
Data = context.ReadBytes();
}
示例5: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
VotingId = context.ReadGuid();
AuthorityIndex = context.ReadInt32();
PartialDeciphers = context.ReadObjectList<PartialDecipher>();
EnvelopeCount = context.ReadInt32();
EnvelopeHash = context.ReadBytes();
Date = context.ReadDateTime();
}
示例6: Deserialize
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
CreationDate = context.ReadDateTime();
Randomness = context.ReadBytes();
}
示例7: RunExtract
private void RunExtract()
{
try
{
Progress = 0;
FileStream fileStream = new FileStream(this.backupFile, FileMode.Open, FileAccess.Read);
GZipStream gzipStream = new GZipStream(fileStream, CompressionMode.Decompress);
DeserializeContext context = new DeserializeContext(gzipStream);
int fileCount = context.ReadInt32();
long totalSize = context.ReadInt64();
long doneSize = 0;
for (int index = 0; index < fileCount; index++)
{
string fileName = context.ReadString();
FileName = fileName;
byte[] data = context.ReadBytes();
File.WriteAllBytes(Path.Combine(this.dataPath, fileName), data);
doneSize += data.Length;
Progress = 1d / (double)totalSize * (double)doneSize;
}
context.Close();
gzipStream.Close();
fileStream.Close();
}
catch (Exception exception)
{
Exception = exception;
}
Complete = true;
}
示例8: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
Data = context.ReadBytes();
Signature = context.ReadBytes();
CertificateData = context.ReadBytes();
}
示例9: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
Exception = context.ReadBoolean() ? null : PiException.FromBinary(context.ReadBytes());
}
示例10: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
VotingId = context.ReadGuid();
VoterId = context.ReadGuid();
SignedEnvelopeHash = context.ReadBytes();
VotingTitle = context.ReadMultiLanguageString();
}
示例11: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
if (!context.ReadBytes().Equal(MagicTypeConstant))
throw new InvalidOperationException("Magic type contant wrong.");
Id = new Guid(context.ReadBytes());
CreationDate = context.ReadDateTime();
PublicKey = context.ReadBytes();
SelfSignature = context.ReadBytes();
this.attributes = context.ReadObjectList<CertificateAttribute>();
this.signatures = context.ReadObjectList<Signature>();
PrivateKeyStatus = (PrivateKeyStatus)context.ReadInt32();
switch (PrivateKeyStatus)
{
case PrivateKeyStatus.Unavailable:
break;
case Crypto.PrivateKeyStatus.Unencrypted:
this.privateKeyData = context.ReadBytes();
break;
case Crypto.PrivateKeyStatus.Encrypted:
this.privateKeyData = context.ReadBytes();
this.privateKeySalt = context.ReadBytes();
this.passphraseSalt = context.ReadBytes();
break;
default:
throw new InvalidOperationException("Unknown or bad private key status.");
}
}
示例12: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
IssuerId = context.ReadGuid();
SymmetricKey = context.ReadBytes();
}
示例13: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
Signature = context.ReadBytes();
SigningCertificate = context.ReadObject<Certificate>();
}
示例14: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
VotingId = context.ReadGuid();
AuthorityIndex = context.ReadInt32();
AcceptShares = context.ReadBoolean();
PublicKeyPart = context.ReadBigInt();
VotingParametersHash = context.ReadBytes();
}
示例15: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
EmailAddress = context.ReadString();
if (version >= 1)
{
EncryptedSignatureRequest = context.ReadBytes();
}
else
{
EncryptedSignatureRequest = new byte[0];
}
}