} // 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
/** * 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()); } }
public static void WriteTo(this WritableContents wc, Stream outputStream) { wc = wc ?? throw new ArgumentNullException(nameof(wc)); wc(outputStream); }
/** * 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)); }