title: IOException: Read Error
body: <p>If you want more info on the error, the full source can be downloaded <a href="http://www.filefactory.com/file/cbcd3ec/n/src.zip" rel="nofollow">here</a></p>
  
  <p>Hey, I'm reading an ini file using java.util.Properties; and I've run into a strange issue. When I try to load a specific file, the thing spits out this strange exception that I've been trying for about a day to eliminate.</p>
  
  <pre><code>java.io.IOException: Read error
      at java.io.FileInputStream.readBytes(Native Method)
      at java.io.FileInputStream.read(Unknown Source)
      at java.util.Properties$LineReader.readLine(Unknown Source)
      at java.util.Properties.load0(Unknown Source)
      at java.util.Properties.load(Unknown Source)
      at IniReader.load(IniReader.java:20)
      at plane.&lt;init&gt;(plane.java:22)
      at renderingArea.&lt;init&gt;(flight_optimizer.java:93)
      at flight_optimizer_GUI.&lt;init&gt;(flight_optimizer.java:159)
      at flight_optimizer.main(flight_optimizer.java:46)
  </code></pre>
  
  <p>I had previously been reading this file just fine with no problems, I then changed a bit of how I was calling and had to add an extra line at the bottom. If I remove that line, the problem does not occour.</p>
  
  <p>the txt file is:</p>
  
  <pre><code>x=0
  y=0
  max_velocity=.1
  passengers=100
  num_planes=1
  </code></pre>
  
  <p>If I remove the num_planes=1 line, the file gets read fine. </p>
  
  <p>Relevant code:</p>
  
  <pre><code>import java.util.Enumeration;
  
  public class IniReader {
  
      //global vars
  
      public IniReader(){
          // initializeing stuffs
      }
  
      public void load(InputStream inStream) throws IOException {
          this.inStream = inStream;
          this.properties.load(this.inStream);
          this.keys = this.properties.propertyNames();
          inStream.close();
      }
  }
  
  class renderingArea extends JPanel {
  
      //Global vars
      private IniReader ini;
  
      public renderingArea(){
          super();
          // Initializing some things 
          files = new fileManager();
          ini = new IniReader();
  
          FileInputStream planeStream;
          FileInputStream cityStream;
          try {
              planeStream = files.getIni("plane.ini");
              ini.load(planeStream);
  
              //extraneous code
  
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e1) {
              e1.printStackTrace();
          } catch (NumberFormatException e1) {
              e1.printStackTrace();
          }   
      }
  
      //moar extraneous code
  
  }
  </code></pre>