inputStream = new BufferedInputStream(inputStream);
}
inputStream.mark(Integer.MAX_VALUE); //we can process at maximum 2G with the standard jdk streams
try {
Transformer transformer = buildTransformerChain(digestOutputStream, signaturePartDef, null);
Map<String, Object> transformerProperties = new HashMap<String, Object>(2);
transformerProperties.put(
AttachmentContentSignatureTransform.ATTACHMENT, attachment);
transformer.setProperties(transformerProperties);
transformer.transform(inputStream);
transformer.doFinal();
digestOutputStream.close();
//reset the inputStream to be able to reuse it
inputStream.reset();