code: private void writeEntry(InputStream input, JarEntry entry) throws IOException {
          // add the entry to the jar archive
          mOutputJar.putNextEntry(entry);
  
          // read the content of the entry from the input stream, and write it into the archive.
          int count;
          while ((count = input.read(mBuffer)) != -1) {
              mOutputJar.write(mBuffer, 0, count);
  
              // update the digest
              if (mMessageDigest != null) {
                  mMessageDigest.update(mBuffer, 0, count);
              }
          }
  
          // close the entry for this file
          mOutputJar.closeEntry();
  
          if (mManifest != null) {
              // update the manifest for this entry.
              Attributes attr = mManifest.getAttributes(entry.getName());
              if (attr == null) {
                  attr = new Attributes();
                  mManifest.getEntries().put(entry.getName(), attr);
              }
              attr.putValue(DIGEST_ATTR, mBase64Encoder.encodeToString(mMessageDigest.digest()));
          }
      }
docs: Adds an entry to the output jar, and write its content from the {@link InputStream}
  @param input The input stream from where to write the entry content.
  @param entry the entry to write in the jar.
  @throws IOException