public class HWPFOldDocument extends HWPFDocumentCore
_cbt, _fib, _ft, _lt, _mainStream, _objectPool, _pbt, _ss, _st, FIB_BASE_LEN, RC4_REKEYING_INTERVAL, STREAM_OBJECT_POOL, STREAM_TABLE_0, STREAM_TABLE_1, STREAM_WORD_DOCUMENT
Constructor and Description |
---|
HWPFOldDocument(DirectoryNode directory) |
HWPFOldDocument(POIFSFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
FontTable |
getFontTable()
Use
getOldFontTable() instead!!! This always throws an
UnsupportedOperationException .
(改用 getOldFontTable() !!!这总是会引发 UnsupportedOperationException。)
|
java.nio.charset.Charset |
getGuessedCharset()
As a rough heuristic (total hack), read through the HPSF, then read through the font table, and take the first non-default, non-ansi, non-symbol font's charset and return that.
(作为一个粗略的启发式(完全破解),通读 HPSF,然后通读字体表,并获取第一个非默认、非 ansi、非符号字体的字符集并返回它。)
|
OldFontTable |
getOldFontTable() |
Range |
getOverallRange()
Returns the range that covers all text in the file, including main text, footnotes, headers and comments
(返回覆盖文件中所有文本的范围,包括正文、脚注、标题和注释)
|
Range |
getRange()
Returns the range which covers the whole of the document, but excludes any headers and footers.
(返回覆盖整个文档的范围,但不包括任何页眉和页脚。)
|
java.lang.StringBuilder |
getText()
Internal method to access document text
(访问文档文本的内部方法)
|
TextPieceTable |
getTextTable() |
void |
write()
Writes the document out to the currently open
File , via the writeable
POIFSFileSystem it was opened from.
(通过打开它的可写 POIFSFileSystem 将文档写入当前打开的文件。)
|
void |
write(java.io.File out)
Writes the document out to the specified new
File .
(将文档写入指定的新文件。)
|
void |
write(java.io.OutputStream out)
Writes the document out to the specified output stream.
(将文档写入指定的输出流。)
|
getCharacterTable, getDocumentEntryBytes, getDocumentText, getEncryptionInfo, getFileInformationBlock, getListTables, getMainStream, getObjectsPool, getParagraphTable, getSectionTable, getStyleSheet, updateEncryptionInfo, verifyAndBuildPOIFS
clearDirectory, close, createInformationProperties, getDirectory, getDocumentSummaryInformation, getEncryptedPropertyStreamName, getPropertySet, getPropertySet, getSummaryInformation, initDirectory, readProperties, replaceDirectory, validateInPlaceWritePossible, writeProperties, writeProperties, writeProperties
public HWPFOldDocument(POIFSFileSystem fs) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public HWPFOldDocument(DirectoryNode directory) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public Range getOverallRange()
HWPFDocumentCore
getOverallRange
in class
HWPFDocumentCore
(类 HWPFDocumentCore 中的 getOverallRange)
@NotImplemented public FontTable getFontTable()
getOldFontTable()
instead!!! This always throws an
UnsupportedOperationException
.
(改用 getOldFontTable() !!!这总是会引发 UnsupportedOperationException。)
getFontTable
in class
HWPFDocumentCore
java.lang.UnsupportedOperationException
- Always.
(java.lang.UnsupportedOperationException - 总是。)
public OldFontTable getOldFontTable()
public Range getRange()
HWPFDocumentCore
getRange
in class
HWPFDocumentCore
(类 HWPFDocumentCore 中的 getRange)
public TextPieceTable getTextTable()
getTextTable
in class
HWPFDocumentCore
(类 HWPFDocumentCore 中的 getTextTable)
public java.lang.StringBuilder getText()
HWPFDocumentCore
getText
in class
HWPFDocumentCore
(类 HWPFDocumentCore 中的 getText)
public void write() throws java.io.IOException
POIDocument
File
, via the writeable
POIFSFileSystem
it was opened from.
This will fail (with an IllegalStateException
if the document was opened read-only, opened from an InputStream
instead of a File, or if this is not the root document. For those cases, you must use POIDocument.write(OutputStream)
or POIDocument.write(File)
to write to a brand new document.
write
in class
POIDocument
(写在类 POIDocument)
java.io.IOException
- thrown on errors writing to the file
(java.io.IOException - 写入文件出错时抛出)
public void write(java.io.File out) throws java.io.IOException
POIDocument
File
. If the file exists, it will be replaced, otherwise a new one will be created
(将文档写入指定的新文件。如果文件存在,则将其替换,否则将创建一个新文件)
write
in class
POIDocument
(写在类 POIDocument)
out
- The new File to write to.
(out - 要写入的新文件。)
java.io.IOException
- thrown on errors writing to the file
(java.io.IOException - 写入文件出错时抛出)
public void write(java.io.OutputStream out) throws java.io.IOException
POIDocument
File
rather than an
InputStream
, you
must write out using
POIDocument.write()
or to a different File. Overwriting the currently open file via an OutputStream isn't possible. If
stream
is a
FileOutputStream
on a networked drive or has a high cost/latency associated with each written byte, consider wrapping the OutputStream in a
BufferedOutputStream
to improve write performance, or use
POIDocument.write()
/
POIDocument.write(File)
if possible.
(将文档写入指定的输出流。作为此操作的一部分,流不会关闭。注意 - 如果文档是从文件而不是 InputStream 打开的,则必须使用 POIDocument.write() 或写入不同的文件。无法通过 OutputStream 覆盖当前打开的文件。如果流是网络驱动器上的 FileOutputStream 或与每个写入字节相关的成本/延迟较高,请考虑将 OutputStream 包装在 BufferedOutputStream 中以提高写入性能,或尽可能使用 POIDocument.write() / POIDocument.write(File) .)
write
in class
POIDocument
(写在类 POIDocument)
out
- The stream to write to.
(out - 要写入的流。)
java.io.IOException
- thrown on errors writing to the stream
(java.io.IOException - 写入流时抛出错误)
public java.nio.charset.Charset getGuessedCharset()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.