1. File.length()
Returns the length of this file in bytes. Returns 0 if the file does not exist. The result for a directory is not defined.
2. InputStream.avalible()
Returns an estimated number of bytes that can be read or skipped without blocking for more input.
..It is particularly important to realize that you must not use this method to size a container and assume that you can read the entirety of the stream without needing to resize the container.
..if you're reading from a file, length()
returns the current length of the file (though assuming the file's length can't change may be incorrect, reading a file is inherently racy).