I'm trying to dispatch some pdf files to my browser via a servlet to control who can get to it and who can't. Using a url with .pdf at the end works fast, but it also means everyone can get to them (even if I don't want everyone to get to them) Currently the PDF files are taking quite some time to dispatch. I'm using some file streaming as you can see below. Is there any technique or different classes I can use to speed this up? Maybe a Buffered File Reader??? What would help?
Here's my code...
[ August 06, 2002: Message edited by: Dale DeMott ]
By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
A Reader will be useless for a PDF file - it's not text data. A BufferedOutputStream would help - but more useful here would be to use the read(byte) and write(byte) methods to push bytes in bulk rather than one at a time:
You could try also wrapping the FileOutputStream with a BufferedOutputStream, but I doubt you'd see much further benefit since you've already got one buffer in the system. Experiment with the buffer size to see what works best for you - there's usually a large range in which the size makes little difference. [ August 06, 2002: Message edited by: Jim Yingst ]