@Override
  public BlobDescriptor writeTo(OutputStream outStream) throws IOException {
    // Cannot rewrite.
    if (isWritten) {
      throw new IllegalStateException("Cannot rewrite Blob backed by an InputStream");
    }
    try (InputStream inStream = this.inputStream) {
      return Digests.computeDigest(inStream, outStream);

    } finally {
      isWritten = true;
    }
  }
Indicates if the {@link Blob} has already been written or not.
jib-core/src/main/java/com/google/cloud/tools/jib/blob/InputStreamBlob.java