Java I/O FileStream issue
<p>I have an input file stream method that will load a file, I just can't figure out how to then use the file in another method. The file has one UTF string and two integers. How can I now use each of these different ints or strings in a main method? Lets say I want print the three different variables to the console, how would I go about doing that? Here's a few things I've tried with the method:</p>

<pre><code>public static  dataStreams() throws IOException { 
    int i = 0;
    char c;
    try (DataInputStream input = new DataInputStream(
            new FileInputStream("input.dat"));
    ) {

        while((i=input.read())!=-1){
             // converts integer to character
            c=(char)i;
        }

        return c;
        return i;
    /*  
        String stringUTF = input.readUTF();
        int firstInt = input.readInt();
        int secondInt = input.readInt();
        */


    }


}
</code></pre>