I would like to return the content of a document in a HttpServletResponse. What I have right now is shown below. Is there a better way? Will this scale for large video content?
InputStream src = new BufferedInputStream(
document.getContentStream().getStream());
BufferedOutputStream dst = new BufferedOutputStream(
response.getOutputStream());
byte[] buff = new byte[2048];
int bytesRead;
while((bytesRead = src.read(buff, 0, buff.length)) != -1) {
dst.write(buff, 0, bytesRead);
}
Thanks.
Naresh
