예제 #1
0
        } // DoVisit

        protected override bool IsEqual(object obj)
        {
            var compare = obj as RtfGroup; // guaranteed to be non-null

            return(compare != null && base.IsEqual(obj) &&
                   WritableContents.Equals(compare.WritableContents));
        } // IsEqual
예제 #2
0
 /**
  * Computes the digest by consuming the contents while copying it to an {@link OutputStream}.
  * Returns the computed digest along with the size of the bytes consumed to compute the digest.
  * Does not close the stream.
  *
  * @param contents the contents to compute digest for
  * @param outStream the stream to which the contents are copied
  * @return computed digest and bytes consumed
  * @throws IOException if reading from or writing fails
  */
 public static BlobDescriptor ComputeDigest(WritableContents contents, Stream outStream)
 {
     using (CountingDigestOutputStream digestOutStream = new CountingDigestOutputStream(outStream, true))
     {
         contents.WriteTo(digestOutStream);
         return(digestOutStream.ComputeDigest());
     }
 }
예제 #3
0
 public static void WriteTo(this WritableContents wc, Stream outputStream)
 {
     wc = wc ?? throw new ArgumentNullException(nameof(wc));
     wc(outputStream);
 }
예제 #4
0
 /**
  * Computes the digest by consuming the contents.
  *
  * @param contents the contents for which the digest is computed
  * @return computed digest and bytes consumed
  * @throws IOException if reading fails
  */
 public static BlobDescriptor ComputeDigest(WritableContents contents)
 {
     return(ComputeDigest(contents, Stream.Null));
 }