totalBytes should be a long, not a double