InputStream to String in Java

Gets the Input From the Command Prompt During your Program Execution(ie., On Runtime) and Stores in the Local String variable.
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.util.Scanner;
   public class StringFromInputStream {
           
            public static void main(String args[]) throws IOException{
                    InputStream iStream = new FileInputStream("f:/forgetcode.txt");
                    String str;
                    BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
                    StringBuffer sbfFileContents = new StringBuffer();
                    String line = null;

                    while( (line = br.readLine()) != null){
                            sbfFileContents.append(line);
                    }
                    str= sbfFileContents.toString();
        str = new Scanner(iStream).useDelimiter("\\A").next();
            }
    }