title: Converting an excel file string to imaginary excel file
body: <p>I am reading an excel file as a text, and I am posting this string to server. However, I couldn't convert this string to a proper data structure to use it as an input for apache poi functions without creating a temp file in the file system. What I want to do is this;</p>
  
  <p>Excel String -> An Excel File Object (imaginary) -> Reading data from this imaginary file</p>
  
  <p>I don't want to create a temp file every time someone tries to upload an excel file.</p>
  
  <p>I tried something like this;</p>
  
  <pre><code>InputStream stream = new ByteArrayInputStream(OntologyContentTxt.getBytes(StandardCharsets.UTF_8));
      HSSFWorkbook wb = new HSSFWorkbook(stream);
  
      HSSFSheet sheet=wb.getSheetAt(0);
      HSSFRow row;
      HSSFCell cell;
  
      Iterator rows = sheet.rowIterator();
  
      while (rows.hasNext())
      {
          row=(HSSFRow) rows.next();
          Iterator cells = row.cellIterator();
  
          while (cells.hasNext())
          {
              cell=(HSSFCell) cells.next();
  
              if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
              {
                  System.out.print(cell.getStringCellValue()+" ");
              }
              else if(cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC)
              {
                  System.out.print(cell.getNumericCellValue()+" ");
              }
  
          }
          System.out.println();
      }}
  </code></pre>
  
  <p>But it gives me this error.</p>
  
  <blockquote>
    <p>org.apache.poi.poifs.filesystem.NotOLE2FileException: Invalid header signature; read 0xE011BDBFEFBDBFEF, expected 0xE11AB1A1E011CFD0 - Your file appears not to be a valid OLE2 document</p>
  </blockquote>
  
  <p>How can I make this kind of convert?</p>
  
  <p>Thanks.</p>