Pretty basic stuff but I can’t find a way to read the size of a file with several gigabytes.
I’m aware of the method File.length.
But int max value is 2,147,483,647.
Is there a standard API method to read the size of a file with more than 2 gigabytes (maybe something that returns the length in kilobytes, or with Long / BigInteger)? If there isn’t, which libraries are used to do that?
Update
People kindly pointed out that I should RTFM. Long max size can fit 8388608 terabytes. 🙂
File.length()returns a long