Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one use TrafficStats.incrementOperationCount()?

Tags:

android

The documentation for TrafficStats.incrementOperationCount() says:

Increment count of network operations performed under the given accounting tag. This can be used to derive bytes-per-operation.

I want to find the total number of bytes transferred during a particular network operation. Since this API claims to help in deriving bytes-per-operation, can someone help me understand how to use it?

like image 680
Dheeraj Vepakomma Avatar asked Mar 19 '26 17:03

Dheeraj Vepakomma


1 Answers

CountingInputStream CountingOutputStream I am not sure this will help you or not, but it do helpful me to get number of bytes sent and received in particular stream.

you can mold the actual use of it, create such logic that addition(number to byte sent and received) is the total number of bytes transferred during a particular network operation

like image 86
Mohammed Azharuddin Shaikh Avatar answered Mar 22 '26 09:03

Mohammed Azharuddin Shaikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!