Read file information in JAVA

FileInputStream fis = new FileInputStream ();
int t = fis.read;
how to see that the read method returns a number of type int? The source code is not implemented?

Feb.26,2021

http://grepcode.com/file/repo.

is implemented, and the native keyword is used here, so it is implemented in JNI .

reference to the corresponding JNI source code: http://hg.openjdk.java.net/jd.


The

read method is an abstract method of the abstract class InputStream, which is implemented in FileInputStream

 public int read() throws IOException {
        return read0();
    }

    private native int read0() throws IOException;

to see the native method, you need to download the complete OpenJDK source package. You can see

Menu