title: BufferedWriter.write() method doesn't write integers to file
body: <pre><code>public void saveToTextFile(String outText) throws IOException
     {
  
         BufferedWriter out = new BufferedWriter(new FileWriter(outText));
         String[] keys=new String[words.size()];
         int[] values=new int[words.size()];
         int i=0;
  
         for(String word : words.keySet())
         {
            keys[i]=word;
            values[i]=words.get(word);
            i++;
            if(i==words.size()) //Έχουμε διασχίσει όλο το HashMap
            {
                break;
            }
         }
  
         bubbleSort(values,keys);
  
         for(i=0;i&lt;words.size();i++)
         {
             out.write(keys[i]);
             out.write(",");
             out.write(values[i]);
             out.write("\n");
         }
  
         out.close();
     }
  </code></pre>
  
  <p>I have the above function and when I open the file it creates it's like: 
  hello, you, are, fine, how, thanks, too, world, and some weird symbols after the first two commas. It's like out.write(values[i]); and out.write("\n"); aren't working! I checked the arrays after the bubbleSort* and they are just fine! The problem appers to be in writing the file...</p>
  
  <p>This is what I get, whick is right:</p>
  
  <pre><code>Word: hello Frequency: 2
  Word: you Frequency: 2
  Word: are Frequency: 1
  Word: fine Frequency: 1
  Word: how Frequency: 1
  Word: thanks Frequency: 1
  Word: too Frequency: 1
  Word: world Frequency: 1
  </code></pre>