@Test public void shouldFlushWholeStreamToHttpResponse() throws IOException { InputStreamDownload fd = new InputStreamDownload(inputStream, "type", "x.txt"); fd.write(response); assertArrayEquals(bytes, outputStream.toByteArray()); }
public void write(HttpServletResponse response) throws IOException { writeDetails(response); OutputStream out = response.getOutputStream(); ByteStreams.copy(stream, out); stream.close(); }
InputStreamDownload implements Download { public void write(HttpServletResponse response) throws IOException { writeDetails(response); OutputStream out = response.getOutputStream(); ByteStreams.copy(stream, out); stream.close(); } }
InputStreamDownload implements Download { public void write(HttpServletResponse response) throws IOException { writeDetails(response); OutputStream out = response.getOutputStream(); ByteStreams.copy(stream, out); stream.close(); } InputStreamDownload(InputStream input, String contentType, String fileName);  InputStreamDownload(InputStream input, String contentType, String fileName, boolean doDownload, long size); }
InputStreamDownload implements Download { public void write(HttpServletResponse response) throws IOException { writeDetails(response); OutputStream out = response.getOutputStream(); ByteStreams.copy(stream, out); stream.close(); } InputStreamDownload(InputStream input, String contentType, String fileName);  InputStreamDownload(InputStream input, String contentType, String fileName, boolean doDownload, long size); void write(HttpServletResponse response); }
InputStreamDownload implements Download { public void write(HttpServletResponse response) throws IOException { writeDetails(response); OutputStream out = response.getOutputStream(); ByteStreams.copy(stream, out); stream.close(); } InputStreamDownload(InputStream input, String contentType, String fileName);  InputStreamDownload(InputStream input, String contentType, String fileName, boolean doDownload, long size); void write(HttpServletResponse response);  }