public static BlobDescriptor computeDigest(InputStream inStream, OutputStream outStream)
      throws IOException {
    WritableContents contents = contentsOut -> ByteStreams.copy(inStream, contentsOut);
    return computeDigest(contents, outStream);
  }
Computes the digest by consuming the contents of an {@link InputStream} 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 either stream.

@param inStream the stream to read the contents from
@param outStream the stream to which the contents are copied
@return computed digest and bytes consumed
@throws IOException if reading from or writing fails
jib-core/src/main/java/com/google/cloud/tools/jib/hash/Digests.java