From 5cf284114a0b5012443b420ab3ab6e862b3c0206 Mon Sep 17 00:00:00 2001 From: knowcenter Date: Mon, 23 Jul 2007 13:40:29 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@140 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../egiz/web/servlets/RetrieveSignatureDataServlet.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/RetrieveSignatureDataServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/RetrieveSignatureDataServlet.java index 402170c..cbc4e06 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/RetrieveSignatureDataServlet.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/RetrieveSignatureDataServlet.java @@ -3,7 +3,9 @@ */ package at.knowcenter.wag.egov.egiz.web.servlets; +import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.InputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -91,7 +93,18 @@ public class RetrieveSignatureDataServlet extends HttpServlet response.setContentType(sd.getMimeType()); response.setCharacterEncoding(sd.getCharacterEncoding()); - response.getOutputStream().write(sd.getData()); + //response.getOutputStream().write(sd.getData()); + + //:::: + InputStream is = new ByteArrayInputStream(sd.getData()); + final int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + int len = -1; + while ((len = is.read(buffer)) != -1) { + response.getOutputStream().write(buffer, 0, len); + } + response.getOutputStream().flush(); + //:::: log.debug("Writing SignatureData finished."); //$NON-NLS-1$ } -- cgit v1.2.3