title: JAVA printwriter increase buffer size from 8192 bytes
body: <p>I'm trying to create a file that maps every possible binary combination of some part of speech tags, and for some reason the java program I've written just stops after 8192 bytes. I assume that this is the maximum buffer size or something? How can I change that?</p>
  
  <p>My code:</p>
  
  <pre><code>    try {
          Scanner in = new Scanner(new FileInputStream(file.getPath()));
          PrintWriter out = new PrintWriter(new FileOutputStream("S2.gr"));
          createS2(in, out);
      } catch (Exception e) {
          System.out.println("There was an error trying to open the files: " + e.getMessage());
      }
  
  
  private static void createS2(Scanner in, PrintWriter out) {
      String[] pos = in.useDelimiter("\\A").next().split("\\n");
      out.println("1\tS2");
      for (String x : pos) {
          out.println("1\tS2\t_" + x);    
      }
      for (String x : pos) {
          String temp = ("1\t_" + x + "\t" + x);
          out.println(temp);
          for (String y : pos) {
              out.println(temp + " _" + y);
          }
      }
      for (String x : pos) {
          System.out.println(x);
      }
  }
  </code></pre>