ServletOutputStream output = response.getOutputStream();
output.write(byte[]);
What is the most effective way to write File to javax.servlet.ServletOutputStream?
EDIT:
won't this be more effective if the NIO was used?
IOUtils.copy(in, out);
out.flush();
//...........
out.close(); // depends on your application
Where in
is the FileInputStream and out
is the SocketOutputStream
.
IOUtils is a utility from Commons IO module in Apache Commons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With