Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Count bytes sent/received

Thread view: 
raven - 02 Nov 2007 19:31 GMT
Hello.
I wonder what is the "official" way of counting (getting the count of) bytes
sent/received by java.io.OutputStream / java.io.InputStream.
So far I've found these 2 things
1. javax.swing.ProgressMonitorInputStream (no mention about monitoring
_output_?)
2.
http://fastutil.dsi.unimi.it/docs/it/unimi/dsi/fastutil/io/MeasurableInputStream.html

TIA
Gordon Beaton - 03 Nov 2007 10:55 GMT
> I wonder what is the "official" way of counting (getting the count
> of) bytes sent/received by java.io.OutputStream /
> java.io.InputStream.

There is no "official" way. Neither will send or receive anything
behind your back, so it's simple to just count them in your code, or
use your own stream classes that do the counting for you (which I'll
guess the second of your references does).

/gordon

--
Roedy Green - 03 Nov 2007 17:07 GMT
On Fri, 02 Nov 2007 19:31:24 +0100, raven
<qs-raven@wp.remove.this.please.pl> wrote, quoted or indirectly quoted
someone who said :

>Hello.
>I wonder what is the "official" way of counting (getting the count of) bytes
[quoted text clipped - 6 lines]
>
>TIA

You could write a CountingFilter that implements a FilterOutputStream
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.