code: private void writeEntry(final InputStream input, final JarEntry entry) throws IOException {
  
  		// add the entry to the jar archive
  		jarOutputStream.putNextEntry(entry);
  
  		// read the content of the entry from the input stream, and write it into the archive.
  		int count;
  
  		while ((count = input.read(buffer)) != -1) {
  
  			jarOutputStream.write(buffer, 0, count);
  
  			if (messageDigest != null) {
  				messageDigest.update(buffer, 0, count);
  			}
  		}
  
  		jarOutputStream.closeEntry();
  
  		if (manifest != null) {
  
  			Attributes attr = manifest.getAttributes(entry.getName());
  			if (attr == null) {
  
  				attr = new Attributes();
  				manifest.getEntries().put(entry.getName(), attr);
  			}
  
  			attr.putValue("SHA1-Digest", new String(Base64.encode(messageDigest.digest()), "ASCII"));
  		}
  	}
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