Package eu.europa.esig.dss.model
Class InMemoryDocument
java.lang.Object
eu.europa.esig.dss.model.CommonDocument
eu.europa.esig.dss.model.InMemoryDocument
- All Implemented Interfaces:
DSSDocument
,Serializable
In memory representation of a document
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.model.CommonDocument
base64EncodeDigestMap, mimeType, name
-
Constructor Summary
ConstructorDescriptionEmpty constructorInMemoryDocument
(byte[] bytes) Creates dss document that retains the data in memoryInMemoryDocument
(byte[] bytes, String name) Creates dss document that retains the data in memoryInMemoryDocument
(byte[] bytes, String name, MimeType mimeType) Creates dss document that retains the data in memoryInMemoryDocument
(InputStream inputStream) Creates dss document that retains the data in memoryInMemoryDocument
(InputStream inputStream, String name) Creates dss document that retains the data in memoryInMemoryDocument
(InputStream inputStream, String name, MimeType mimeType) Creates dss document that retains the data in memory -
Method Summary
Modifier and TypeMethodDescriptionstatic InMemoryDocument
Creates an empty in memory documentGets base64-encoded content of the documentbyte[]
getBytes()
Gets binary content of the documentOpens aInputStream
on theDSSDocument
contents.void
setBytes
(byte[] bytes) Sets binary content of the documentMethods inherited from class eu.europa.esig.dss.model.CommonDocument
getDigest, getMimeType, getName, save, setMimeType, setName, toString, writeTo
-
Constructor Details
-
InMemoryDocument
public InMemoryDocument()Empty constructor -
InMemoryDocument
public InMemoryDocument(byte[] bytes) Creates dss document that retains the data in memory- Parameters:
bytes
- array of bytes representing the document
-
InMemoryDocument
Creates dss document that retains the data in memory- Parameters:
bytes
- array of bytes representing the documentname
- the file name if the data originates from a file
-
InMemoryDocument
Creates dss document that retains the data in memory- Parameters:
bytes
- array of bytes representing the documentname
- the file name if the data originates from a filemimeType
- the mime type of the file if the data originates from a file
-
InMemoryDocument
Creates dss document that retains the data in memory- Parameters:
inputStream
- input stream representing the document
-
InMemoryDocument
Creates dss document that retains the data in memory- Parameters:
inputStream
- input stream representing the documentname
- the file name if the data originates from a file
-
InMemoryDocument
Creates dss document that retains the data in memory- Parameters:
inputStream
- input stream representing the documentname
- the file name if the data originates from a filemimeType
- the mime type of the file if the data originates from a file
-
-
Method Details
-
createEmptyDocument
Creates an empty in memory document- Returns:
InMemoryDocument
-
openStream
Description copied from interface:DSSDocument
Opens aInputStream
on theDSSDocument
contents. The type of theInputStream
depends on the type of theDSSDocument
.- Returns:
- an
InputStream
-
getBytes
public byte[] getBytes()Gets binary content of the document- Returns:
- byte array
-
setBytes
public void setBytes(byte[] bytes) Sets binary content of the document- Parameters:
bytes
- byte array
-
getBase64Encoded
Gets base64-encoded content of the document- Returns:
String
base64 encoded
-