This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes PDF File not streaming correctly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "PDF File not streaming correctly" Watch "PDF File not streaming correctly" New topic

PDF File not streaming correctly

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
Okay... So I have all my pdf files going through the below method correct. All but 1 file. The only file that won't show up correctly the first time through is a file that is 5K large. If I hit refresh it shows up, however if its the first time through it only shows a white screen.

Here's my code.

Can anyone help!?

By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
are you sure that you are actually reading anything in on the first connection. Since you are using a buffered input stream, and the file is really small, this might be a source of the problem
I agree. Here's the link:
subject: PDF File not streaming correctly
Similar Threads
Is it possible to read a word document using FileReader or FileInputStream?
Transfer multiple files from Server to Client using Sockets
Corrupt PDF Files
Efficient Streaming Methods
Socket connection program works for localhost but not for other ip