예제 #1
0
 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;
 }
예제 #3
0
 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);
 }