title: FileInputStream.read throws java.io.IOException: Result too large
body: <p>I have a temp file</p>
  
  <pre><code>File myTmpFile = File.createTempFile( prefix, suffix );
  </code></pre>
  
  <p>which represents a xml that was exported via</p>
  
  <pre><code>Preferences.exportSubtree(OutputStream);
  </code></pre>
  
  <p>Now i want to import this file with:</p>
  
  <pre><code>Preferences.importPreferences( new FileInputStream( myTmpFile ));
  </code></pre>
  
  <p>But the Stream throws an IOException with the Message("Result too large").<br>
  What does this mean? How can I fix this?</p>
  
  <pre><code>java.io.IOException: Result too large
  at java.io.FileInputStream.read(Native Method)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2932)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:704)
  at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
  at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
  at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
  at java.util.prefs.XmlSupport.loadPrefsDoc(XmlSupport.java:233)
  at java.util.prefs.XmlSupport.importPreferences(XmlSupport.java:182)
  at java.util.prefs.Preferences.importPreferences(Preferences.java:1236)
  at MyPreferences.importPrefs(MyPreferences.java:322)    
  </code></pre>
  
  <p><p></p>
  
  <pre><code>public static void importPrefs(File file){
      FileInputStream is = null;
      try {
          is = new FileInputStream(file);
          java.util.prefs.Preferences.importPreferences( is );
      } catch( FileNotFoundException e ) {
      } catch( IOException e ) {
          e.printStackTrace();
      } catch( InvalidPreferencesFormatException e ) {
      } finally {
          if (is != null) {
              try {
                  is.close();
              } catch( IOException e ) {
              }
          }
      }
  }
  </code></pre>