title: How to convert bytes into megabits in Java?
body: <p>I have a PCAP file and I am writing a script to get details from the packet trace. I am trying to find the average bandwidth of the packet trace and I am stuck on converting a certain amount of <strong>bytes into megabits</strong>. I know 8 bits = 1 byte, and 1 Megabyte = 10^6 bytes, but am confused on how to implement such a conversion in Java.</p>