title: How to go back to the first line in a text file without reading it again?
body: <p>I wrote this code and I think I went to the last line of the code while using line=input.nextLine(). Now I don't know how do I get back to the first line of the text file again. I am not allowed to read the file again.</p>
  
  <pre><code>        File file = new File(fileName);
  
          input = new Scanner(file);
          bufRdr  = new BufferedReader(new FileReader(file));
  
  
          this.cols=bufRdr.readLine().length();
          while (input.hasNext()){
              this.rows++;
              line=input.nextLine();
          }   
          theMaze=new char[this.rows][this.cols];
          int i=0;
          while(i&lt;this.rows){
              line=input.nextLine();
              for (int j=0;j&lt;this.cols;j++){
                  theMaze[i][j]=line.charAt(j);
                  }
              i++;
  
          }
      } catch(Exception e){
          System.out.println("Error......" +e.getMessage());
      }
  </code></pre>