File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
How to determine contentLength
Joined: May 02, 2003
Jun 25, 2008 15:23:00
I need to use the response.setContentLength() method in my
, but I'm not sure how to determine the content length of the actual data I will be sending. I'm working with a basic
Joined: Nov 06, 2000
Jun 25, 2008 15:32:00
I am confused. Can't you just check the length?
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Author and all-around good cowpoke
Joined: Mar 22, 2000
Jun 26, 2008 07:21:00
If you write the data into a
first, you will be able to use the resulting size() and then write the buffer to the response output stream.
See the java.io package javadocs for details
I agree. Here's the link:
subject: How to determine contentLength
Controlling Button Focus with Arrow Keys
ip address ?
Class output directory ni SunOne EE
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014