当前位置: 首页>>代码示例>>Java>>正文


Java DocumentInputStream类代码示例

本文整理汇总了Java中org.apache.poi.poifs.filesystem.DocumentInputStream的典型用法代码示例。如果您正苦于以下问题:Java DocumentInputStream类的具体用法?Java DocumentInputStream怎么用?Java DocumentInputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DocumentInputStream类属于org.apache.poi.poifs.filesystem包,在下文中一共展示了DocumentInputStream类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sanitizeSummaryInformation

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
protected void sanitizeSummaryInformation(BleachSession session, DocumentEntry dsiEntry) {
    try (DocumentInputStream dis = new DocumentInputStream(dsiEntry)) {
        PropertySet ps = new PropertySet(dis);
        // Useful for debugging purposes
        // LOGGER.debug("PropertySet sections: {}", ps.getSections());
        SummaryInformation dsi = new SummaryInformation(ps);

        sanitizeSummaryInformation(session, dsi);
    } catch (NoPropertySetStreamException | UnexpectedPropertySetTypeException | MarkUnsupportedException | IOException e) {
        LOGGER.error("An error occured while trying to sanitize the document entry", e);
    }
}
 
开发者ID:docbleach,项目名称:DocBleach,代码行数:13,代码来源:SummaryInformationSanitiser.java

示例2: setByteArrayInputStream

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
/**
 * 압축된 스트림을 읽어 압축을 풀어서 압축 풀린 데이터로 InputStream을 만든다.
 * 
 * @param de
 *            스트림을 가리키는 Apache POI 객체
 * @throws Exception
 */
private void setByteArrayInputStream(DocumentEntry de) throws Exception {
	DocumentInputStream dis = new DocumentInputStream(de);
	byte[] compressed = getCompressedBytes(dis, de.getSize());
	dis.close();

	byte[] decompressed = decompress(compressed);
	bis = new ByteArrayInputStream(decompressed);
	setSize(decompressed.length);
}
 
开发者ID:neolord0,项目名称:hwplib,代码行数:17,代码来源:StreamReaderForCompress.java

示例3: checkCompoundStorage

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
private static void checkCompoundStorage(OleBlob.CompoundContent cc, 
                                         Attachment attach)
  throws Exception
{
  File tmpData = File.createTempFile("attach_", ".dat");

  try {
    FileOutputStream fout = new FileOutputStream(tmpData);
    fout.write(attach.getFileData());
    fout.close();

    NPOIFSFileSystem attachFs = new NPOIFSFileSystem(tmpData, true);

    for(OleBlob.CompoundContent.Entry e : cc) {
      DocumentEntry attachE = null;
      try {
        attachE = CompoundOleUtil.getDocumentEntry(e.getName(), attachFs.getRoot());
      } catch(FileNotFoundException fnfe) {
        // ignored, the ole data has extra entries
        continue;
      }

      byte[] attachEBytes = toByteArray(new DocumentInputStream(attachE), 
                                        attachE.getSize());
      byte[] entryBytes = toByteArray(e.getStream(), e.length());

      assertTrue(Arrays.equals(attachEBytes, entryBytes));
    }

    ByteUtil.closeQuietly(attachFs);
    
  } finally {
    tmpData.delete();
  }    
}
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:36,代码来源:OleBlobTest.java

示例4: getStream

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
public InputStream getStream() throws IOException {
  return new DocumentInputStream(_docEntry);
}
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:4,代码来源:CompoundOleUtil.java

示例5: StreamReaderForNormal

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
/**
 * 생성자
 * 
 * @param de
 *            스트림을 가리키는 Apache POI 객체
 * @param fileVersion
 * @throws IOException
 */
public StreamReaderForNormal(DocumentEntry de, FileVersion fileVersion)
		throws IOException {
	super();
	dis = new DocumentInputStream(de);
	setSize(de.getSize());
	setFileVersion(fileVersion);
}
 
开发者ID:neolord0,项目名称:hwplib,代码行数:16,代码来源:StreamReaderForNormal.java

示例6: getCompressedBytes

import org.apache.poi.poifs.filesystem.DocumentInputStream; //导入依赖的package包/类
/**
 * 스트림에서 압축된 데이터를 읽는다.
 * 
 * @param dis
 *            스트림을 읽기 위한 Apache POI InputStream 객체
 * @param size
 *            읽을 크기
 * @return 압축된 데이터
 * @throws IOException
 */
private byte[] getCompressedBytes(DocumentInputStream dis, int size)
		throws IOException {
	byte[] buffer = new byte[size];
	dis.read(buffer);
	return buffer;
}
 
开发者ID:neolord0,项目名称:hwplib,代码行数:17,代码来源:StreamReaderForCompress.java


注:本文中的org.apache.poi.poifs.filesystem.DocumentInputStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。