Anyone know how to determine the ammount of data that has been tranferred to a server once the applet has written its byte to a DataOutputStream. I thought DataOutputStream.size() would work but it only returns the size of the byte not the ammout of data transferred to the server. The calculation/determination must be done client side. Could anyone help me out of a hole here? Thanks for all of your help.
Joined: Jul 19, 2001
Hi Declan, Think u want to know the size of the file.Make an instanse of your data stream in to a file and u can easily get the size of the file. fis = new FileInputStream(source); File file=new File(source); long filesz=file.length(); Bipul
Joined: Jul 03, 2001
No I need to get the actual length of the data being transferred to the servlet, not a static filesize.
Author and all-around good cowpoke
Joined: Mar 22, 2000
If the total data isn't too big you can build your DataOutputStream from a ByteArrayOutputStream. When everything has been written you can look at the resulting byte size before actually sending it. Bill