This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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
It is sorta covered in the JavaRanch Style Guide.
subject: PDF File not streaming correctly
Similar Threads
Socket connection program works for localhost but not for other ip
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