dcsimg
how to get an exact size of an attched file (Part)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sharona_Feinberg
Posted On:   Tuesday, February 19, 2002 05:01 AM

Hi


I would like to know how to get the exact measure of the content size .



the method part.getSize()


returns the size not accurately!



thanks in advance

Re: how to get an exact size of an attched file (Part)

Posted By:   Sharona_Feinberg  
Posted On:   Tuesday, February 19, 2002 05:53 AM

thanks ,


I have found a way.


getting the inputStream of a Part.
allocating an extra size to a byte[] b,


using :


byte[] b = new byte(bigSize);


InputStream is = part.getInputstream();


int c = is.read(b,0,bigSize);



c is the correct size !
About | Sitemap | Contact