title: how to get the inputStream from Workbook object in java
body: <p>When I upload the file i am passing the inputstream to the workbook. Now I want to use this <code>InputStream</code> from workbook in another method like save where I save the file <code>InputStream</code> in to DB. Here is my code.</p>
  
  <pre><code>public void FileUpload(FileUploadEvent event) throws ParseException  {
      UploadedFile item = event.getUploadedFile();
      Workbook workbook = org.apache.poi.ss.usermodel.WorkbookFactory.create(item.getInputStream());
  }
  </code></pre>
  
  <p>Now I want to make Workbook object as instance variable and pass to another method like below.</p>
  
  <pre><code>public String save() throws SQLException, IOException{
      fileId = dao.savefile(workbook,fileName);
  }
  </code></pre>
  
  <p>In my savefile method </p>
  
  <pre><code>InputStream inptest=  **workbook.getStream**
      ps.setBinaryStream(2,fin,fin.available()); 
  </code></pre>
  
  <p>So <code>inptest</code> variable accepts <code>InputStream</code> which I wanted to get it from Workbook.</p>