title: Java POI - Error: Unable to read entire header
body: <p>I'm trying to read a .doc file with java through the POI library. Here is my code:</p>
  
  <pre><code>FileInputStream fis = new FileInputStream(file.getAbsolutePath());
  HWPFDocument document = new HWPFDocument(fis);
  WordExtractor extractor = new WordExtractor(document);
  String [] fileData = extractor.getParagraphText();
  </code></pre>
  
  <p>And I have this exception:</p>
  
  <pre><code>java.io.IOException: Unable to read entire header; 162 bytes read; expected 512 bytes
  at org.apache.poi.poifs.storage.HeaderBlock.alertShortRead(HeaderBlock.java:226)
  at org.apache.poi.poifs.storage.HeaderBlock.readFirst512(HeaderBlock.java:207)
  at org.apache.poi.poifs.storage.HeaderBlock.&lt;init&gt;(HeaderBlock.java:104)
  at org.apache.poi.poifs.filesystem.POIFSFileSystem.&lt;init&gt;(POIFSFileSystem.java:138)
  at MicrosoftWordParser.getDocString(MicrosoftWordParser.java:277)
  at MicrosoftWordParser.main(MicrosoftWordParser.java:86)
  </code></pre>
  
  <p>My file is not corrupted, i can launch it with microsoft Word.</p>
  
  <p>I'm using poi 3.9 (the latest stable version).</p>
  
  <p>Do you have an idea t solve the problem ?</p>
  
  <p>Thank you.</p>