public final class MemoryPackagePart extends PackagePart
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data
Storage for the part data.
|
protected int |
length
Size of data.
|
_container, _contentType, _partName
Constructor and Description |
---|
MemoryPackagePart(OPCPackage pack,
PackagePartName partName,
String contentType)
Constructor.
|
MemoryPackagePart(OPCPackage pack,
PackagePartName partName,
String contentType,
boolean loadRelationships)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
close()
Close this part : flush this part, close the input stream and output
stream.
|
void |
flush()
Flush the content of this part.
|
protected InputStream |
getInputStreamImpl()
Abtract method that get the input stream of this part.
|
protected OutputStream |
getOutputStreamImpl()
Abstract method that get the output stream of this part.
|
boolean |
load(InputStream ios)
Load the content of this part.
|
boolean |
save(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, getContentType, getInputStream, getOutputStream, getPackage, getPartName, getRelatedPart, getRelationship, getRelationships, getRelationshipsByType, hasRelationships, isDeleted, isRelationshipExists, isRelationshipPart, removeRelationship, setContentType, setDeleted, toString
protected byte[] data
protected int length
public MemoryPackagePart(OPCPackage pack, PackagePartName partName, String contentType) throws InvalidFormatException
pack
- The owner package.partName
- The part name.contentType
- The content type.InvalidFormatException
- If the specified URI is not OPC compliant.public MemoryPackagePart(OPCPackage pack, PackagePartName partName, String contentType, boolean loadRelationships) throws InvalidFormatException
pack
- The owner package.partName
- The part name.contentType
- The content type.loadRelationships
- Specify if the relationships will be loaded.InvalidFormatException
- If the specified URI is not OPC compliant.protected InputStream getInputStreamImpl()
PackagePart
getInputStreamImpl
in class PackagePart
protected OutputStream getOutputStreamImpl()
PackagePart
getOutputStreamImpl
in class PackagePart
public void clear()
public boolean save(OutputStream os) throws OpenXML4JException
PackagePart
save
in class PackagePart
os
- Output stream to save this part.OpenXML4JException
- If any exception occur.public boolean load(InputStream ios) throws InvalidFormatException
PackagePart
load
in class PackagePart
ios
- The input stream of the content to load.InvalidFormatException
- Throws if the content format is invalid.public void close()
PackagePart
close
in class PackagePart
public void flush()
PackagePart
flush
in class PackagePart
Copyright © 2020. All rights reserved.