title: Invalid Header Signature
body: <p>Here I want to extract the data from <code>.xlsx</code> file and for that I already add the poi jar and created the reference of <code>fileInputStream</code>     </p>
  
  <pre><code>package demo;
  
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  
  import org.apache.poi.hssf.usermodel.HSSFSheet;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  
  public class DemoExcel {
  
      public static void main(String[] args) throws Exception{
          File excel = new File("C:\\Users\\Devaditya\\Documents\\Book1.xlsx");
          FileInputStream fis = null;
          fis = new FileInputStream(excel);
          System.out.println(fis.toString());
          HSSFWorkbook wb = new HSSFWorkbook(fis);
          System.out.println(wb.toString());
          HSSFSheet sh = wb.getSheet("Data");
          System.out.println(sh.toString());
      }
  
  }
  </code></pre>
  
  <p>Here i am getting the error:-</p>
  
  <pre><code>Exception in thread "main" java.io.IOException: Invalid header signature; read 0, expected -2226271756974174256
      at org.apache.poi.poifs.storage.HeaderBlockReader.&lt;init&gt;(HeaderBlockReader.java:88)
      at org.apache.poi.poifs.filesystem.POIFSFileSystem.&lt;init&gt;(POIFSFileSystem.java:83)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.&lt;init&gt;(HSSFWorkbook.java:210)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.&lt;init&gt;(HSSFWorkbook.java:191)
      at demo.DemoExcel.main(DemoExcel.java:23)
  </code></pre>