org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes()方法的一些代码示例,展示了HSSFWorkbook.getBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.getBytes()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:getBytes

HSSFWorkbook.getBytes介绍

[英]Method getBytes - get the bytes of just the HSSF portions of the XLS file. Use this to construct a POI POIFSFileSystem yourself.
[中]方法getBytes—仅获取XLS文件的HSSF部分的字节。您可以自己使用它来构建POI POIFSS文件系统。

代码示例

代码示例来源:origin: org.apache.poi/poi

fs.createDocument(new ByteArrayInputStream(getBytes()), "Workbook");

代码示例来源:origin: org.apache.poi/poi

/**
 * Write out this workbook to the currently open {@link File} via the
 *  writeable {@link POIFSFileSystem} it was opened as. 
 *  
 * <p>This will fail (with an {@link IllegalStateException} if the
 *  Workbook was opened read-only, opened from an {@link InputStream}
 *   instead of a File, or if this is not the root document. For those cases, 
 *   you must use {@link #write(OutputStream)} or {@link #write(File)} to 
 *   write to a brand new document.
 */
@Override
public void write() throws IOException {
  validateInPlaceWritePossible();
  final DirectoryNode dir = getDirectory();
  
  // Update the Workbook stream in the file
  DocumentNode workbookNode = (DocumentNode)dir.getEntry(
      getWorkbookDirEntryName(dir));
  POIFSDocument workbookDoc = new POIFSDocument(workbookNode);
  workbookDoc.replaceContents(new ByteArrayInputStream(getBytes()));
  
  // Update the properties streams in the file
  writeProperties();
  
  // Sync with the File on disk
  dir.getFileSystem().writeFilesystem();
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

throws IOException
byte[] bytes = getBytes();
POIFSFileSystem fs = new POIFSFileSystem();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

fs.createDocument(new ByteArrayInputStream(getBytes()), "Workbook");

代码示例来源:origin: com.haulmont.thirdparty/poi

throws IOException
byte[] bytes = getBytes();
POIFSFileSystem fs = new POIFSFileSystem();

代码示例来源:origin: org.apache.portals.applications/apa-dbbrowser-jar

response.getPortletOutputStream().write(excelWorkbook.getBytes());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Write out this workbook to the currently open {@link File} via the
 *  writeable {@link POIFSFileSystem} it was opened as. 
 *  
 * <p>This will fail (with an {@link IllegalStateException} if the
 *  Workbook was opened read-only, opened from an {@link InputStream}
 *   instead of a File, or if this is not the root document. For those cases, 
 *   you must use {@link #write(OutputStream)} or {@link #write(File)} to 
 *   write to a brand new document.
 */
@Override
public void write() throws IOException {
  validateInPlaceWritePossible();
  final DirectoryNode dir = getDirectory();
  
  // Update the Workbook stream in the file
  DocumentNode workbookNode = (DocumentNode)dir.getEntry(
      getWorkbookDirEntryName(dir));
  POIFSDocument workbookDoc = new POIFSDocument(workbookNode);
  workbookDoc.replaceContents(new ByteArrayInputStream(getBytes()));
  
  // Update the properties streams in the file
  writeProperties();
  
  // Sync with the File on disk
  dir.getFileSystem().writeFilesystem();
}

相关文章

HSSFWorkbook类方法