private static void WriteMetadataInternal(BinaryWriter bw, SignatureMetadata metadata)
 {
     bw.Write(FastRsyncBinaryFormat.SignatureHeader);
     bw.Write(FastRsyncBinaryFormat.Version);
     var metadataStr = JsonConvert.SerializeObject(metadata, JsonSerializationSettings.JsonSettings);
     bw.Write(metadataStr);
 }
示例#2
0
 public Signature(SignatureMetadata metadata, RsyncFormatType type)
 {
     HashAlgorithm            = SupportedAlgorithms.Hashing.Create(metadata.ChunkHashAlgorithm);
     RollingChecksumAlgorithm = SupportedAlgorithms.Checksum.Create(metadata.RollingChecksumAlgorithm);
     Chunks   = new List <ChunkSignature>();
     Metadata = metadata;
     Type     = type;
 }
 public async Task WriteMetadataAsync(SignatureMetadata metadata)
 {
     var ms = new MemoryStream(256);
     var msbw = new BinaryWriter(ms);
     WriteMetadataInternal(msbw, metadata);
     ms.Seek(0, SeekOrigin.Begin);
     await ms.CopyToAsync(_signatureStream).ConfigureAwait(false);
 }
示例#4
0
 public void WriteMetadata(SignatureMetadata metadata)
 {
     WriteMetadataInternal(signaturebw, metadata);
 }