Writing data back to binary file
<p>I am trying to write char, double and integer back to my binary file base on my String arraylist. However, after finishing writing and I read the binary file again it generates erros. Anyone could help with this I really appreciate it.</p>

<pre><code>ArrayList&lt;String&gt;temp = new ArrayList&lt;String&gt;();
    for(int i = 0;i&lt;temp.size();i++){
                String decimalPattern = "([0-9]*)\\.([0-9]*)";  
                boolean match = Pattern.matches(decimalPattern, temp.get(i));
                if(Character.isLetter(temp.get(i).charAt(0))){
                    os.writeChar(temp.get(i).charAt(0));
                }
                else if(match == true){
                    Double d = Double.parseDouble(temp.get(i));
                    os.writeDouble(d);
                }       
                else
                {
                 int in = Integer.parseInt(temp.get(i));
                 os.writeInt(in);
                }
            }
            os.close();
         }
</code></pre>
