Hello,
Yes there is a way, while your reading your file:
import java.util.zip.*;//need to import this class
static int k = 0;
static InputStream inStream = null;
static OutputStream outStream = null;
static BufferedReader br = null;
Adler32 adler32 = new Adler32();
byte[] buffer = new byte[1024];
while ( (k = inStream.read(buffer))!= -1)
{
adler32.update(buffer, 0, k);
outStream.write(buffer, 0, k);
}
System.out.print(Long.toString(adler32.getValue() );
I hope it helps
You are not comparing the size of the data, but the checksum.
What I want is to know how many bytes were actually sent over the network, by that I really mean the number of bytes sent..
For example if I sent "Hello" thru an SSLSocket, I want an answer like "To send your hello message, 200 bytes have been sent thru the network, that includes the encryption, the keys, handshake, etc."