title: ReadLong and WriteLong methods in Java.Random.IO
body: <p>I am trying to write Long using Java command for Random File IO as follows:</p>
  
  <pre><code>fstreamOut = new FileOutputStream(new File("C:\\Basmah","dataOutput.7"),true);
  DataOutputStream out=new DataOutputStream(fstreamOut);
  Long p= Long.parseLong(longNumberInString );  // Number of digits for this long key are 7-15
                out.writeLong(p);                  
  </code></pre>
  
  <p>The problem is that when I write 7-15 digit number using writeLong ; it writes 8 bytes in file.
  Then I am trying to read the same record into my program and decode it</p>
  
  <pre><code>Long l=in.readLong();
  </code></pre>
  
  <p>but I dont get the same number as I wrote ; Instead Iget EOF exception.</p>