public final class MemoryPackagePart extends PackagePart
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data
Storage for the part data.
(零件数据的存储。)
|
_container, _contentType, _partName
Constructor and Description |
---|
MemoryPackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType)
Constructor.
|
MemoryPackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType, boolean loadRelationships)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Allows sub-classes to clean up before new data is added.
(允许子类在添加新数据之前进行清理。)
|
void |
close()
Close this part : flush this part, close the input stream and output stream.
(关闭此部分:刷新此部分,关闭输入流和输出流。)
|
void |
flush()
Flush the content of this part.
(刷新这部分的内容。)
|
protected java.io.InputStream |
getInputStreamImpl()
Method that gets the input stream for this part.
(获取此部分的输入流的方法。)
|
protected java.io.OutputStream |
getOutputStreamImpl()
Method that gets the output stream for this part.
(获取此部分的输出流的方法。)
|
long |
getSize() |
boolean |
load(java.io.InputStream ios)
Load the content of this part.
(加载这部分的内容。)
|
boolean |
save(java.io.OutputStream os)
Save the content of this part and the associated relationships part (if this part own at least one relationship) into the specified output stream.
(将此部分的内容和关联的关系部分(如果此部分至少拥有一个关系)保存到指定的输出流中。)
|
addExternalRelationship, addExternalRelationship, addRelationship, addRelationship, addRelationship, addRelationship, clearRelationships, compareTo, findExistingRelation, getContentType, getContentTypeDetails, getInputStream, getOutputStream, getPackage, getPartName, getRelatedPart, getRelationship, getRelationships, getRelationshipsByType, hasRelationships, isDeleted, isRelationshipExists, isRelationshipPart, removeRelationship, setContentType, setDeleted, toString
public MemoryPackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType) throws InvalidFormatException
pack
- The owner package.
(pack - 所有者包。)
partName
- The part name.
(partName - 部分名称。)
contentType
- The content type.
(contentType - 内容类型。)
InvalidFormatException
- If the specified URI is not OPC compliant.
(InvalidFormatException - 如果指定的 URI 不符合 OPC。)
public MemoryPackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType, boolean loadRelationships) throws InvalidFormatException
pack
- The owner package.
(pack - 所有者包。)
partName
- The part name.
(partName - 部分名称。)
contentType
- The content type.
(contentType - 内容类型。)
loadRelationships
- Specify if the relationships will be loaded.
(loadRelationships - 指定是否将加载关系。)
InvalidFormatException
- If the specified URI is not OPC compliant.
(InvalidFormatException - 如果指定的 URI 不符合 OPC。)
protected java.io.InputStream getInputStreamImpl()
PackagePart
getInputStreamImpl
in class
PackagePart
(类 PackagePart 中的 getInputStreamImpl)
protected java.io.OutputStream getOutputStreamImpl()
PackagePart
getOutputStreamImpl
in class
PackagePart
(类 PackagePart 中的 getOutputStreamImpl)
public long getSize()
getSize
in class
PackagePart
public void clear()
PackagePart
clear
in class
PackagePart
public boolean save(java.io.OutputStream os) throws OpenXML4JException
PackagePart
save
in class
PackagePart
(保存在 PackagePart 类中)
os
- Output stream to save this part.
(os - 输出流以保存这部分。)
POILogger
(如果内容已成功存储,则为 true,否则为 false。有关错误的更多信息可以通过 POILogger 记录)
OpenXML4JException
- If any exception occur.
(OpenXML4JException - 如果发生任何异常。)
public boolean load(java.io.InputStream ios) throws InvalidFormatException
PackagePart
load
in class
PackagePart
(在类 PackagePart 中加载)
ios
- The input stream of the content to load.
(ios - 要加载的内容的输入流。)
POILogger
(如果内容已成功加载,则为 true,否则为 false。有关错误的更多信息可以通过 POILogger 记录)
InvalidFormatException
- Throws if the content format is invalid.
(InvalidFormatException - 如果内容格式无效则抛出。)
public void close()
PackagePart
close
in class
PackagePart
(在类 PackagePart 中关闭)
public void flush()
PackagePart
flush
in class
PackagePart
(在类 PackagePart 中刷新)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.