Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
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
Java Resources at
It is sorta covered in the
JavaRanch Style Guide
subject: How to determine contentLength
ip address ?
Controlling Button Focus with Arrow Keys
Class output directory ni SunOne EE
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013