Results 1 to 3 of 3
Thread: Outputstream not streaming.
- 10-10-2008, 10:57 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 1
- Rep Power
- 0
Outputstream not streaming.
In the following code, can anybody please tell me at what point the data actually starts to get transferred and the popup "download file" box appears? I'm thinking that the dialog box should appear on the first outputstream.write and start transferring data. But I don't think that's the case because the "Page cannot be displayed" is displayed after "waiting" for quite awhile. On a smaller dataset (shorter while loop) with less "wait", dialog box eventually appears and the data gets transferred properly. Larger dataset with longer wait always times out.
Is there some sort of a web server configuration that tells it to write out the data ONLY if outputstream closes? I But isn't the default Transport "chunked"? Could it be possible that the web server somehow got configured to never use "chunked"? If so, how would that happen? We're using Oracle AppServer 10g. Thanks - any help would be appreciated.
response.setHeader("Expires", "0");
response.setHeader("Content-disposition","inline;filename=Download.csv");
response.setContentType("application/x-msdownload");
outputStream = response.getOutputStream();
bufferInBytes = this.getData();
while (bufferInBytes != null)
{
outputStream.write(bufferInBytes, 0, bufferInBytes.length);
outputStream.flush();
bufferInBytes = this.getData();
}
outputStream.close();
- 03-13-2009, 08:00 PM #2
Member
- Join Date
- Mar 2009
- Posts
- 13
- Rep Power
- 0
i wouldn't use flush everytime.
maybe you can use a PrintWriter i think that could work better.
you have to init it with PrintWriter(OutputStream out, true) ;
that means that the printWriter automatic flushes the data
- 03-14-2009, 07:36 AM #3
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
Similar Threads
-
video streaming
By anniya0n in forum JDBCReplies: 3Last Post: 05-08-2013, 03:21 PM -
interrupting urlconnection's outputstream
By zynasis in forum NetworkingReplies: 5Last Post: 10-02-2008, 12:49 AM -
Converting InputStream to OutputStream
By Java Tip in forum Java TipReplies: 1Last Post: 01-11-2008, 10:13 PM -
HashMap to share OutputStream
By gabriel in forum Advanced JavaReplies: 1Last Post: 08-06-2007, 05:47 PM -
PeerStream Audio Video Streaming Server 4.61
By levent in forum Java SoftwareReplies: 0Last Post: 07-31-2007, 07:50 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks