Skip to content

@neophob /gist:3141124
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Stream node.js to struts
protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
URL url = new URL("http://192.168.128.160:8001/grepper.htm");
HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();
BufferedInputStream bis = new BufferedInputStream(httpcon.getInputStream());
ServletOutputStream out = response.getOutputStream();
log.debug("streamopen");
byte[] outputByte = new byte[4096];
int i=0;
//copy binary content to output stream
while ((i = bis.read(outputByte, 0, 4096)) != -1) {
log.debug("stream "+i+" bytes");
out.write(outputByte, 0, i);
}
httpcon.disconnect();
bis.close();
out.flush();
out.close();
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.