title: Reading huge line of string from text file
body: <p>I have a large text file but doesn't have any line break. It just contains a long String (1 huge line of String with all ASCII characters), but so far anything works just fine as I can be able to read the whole line into memory in Java, but i am wondering if there could be a memory leak issue as the file becomes so big like 5GB+ and the program can't read the whole file into memory at once, so in that case what will be the best way to read such file ? Can we break the huge line into 2 parts or even multiple chunks ?  </p>
  
  <p>Here's how I read the file </p>
  
  <pre><code>   BufferedReader buf = new BufferedReader(new FileReader("input.txt"));
     String line;
     while((line = buf.readLine()) != null){
  
     }
  </code></pre>