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
public class InMemoryDocument extends CommonDocument
In memory representation of a document- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class eu.europa.esig.dss.model.CommonDocument
absolutePath, base64EncodeDigestMap, mimeType, name
-
-
Constructor Summary
Constructors Constructor Description InMemoryDocument()InMemoryDocument(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 Type Method Description StringgetBase64Encoded()byte[]getBytes()InputStreamopenStream()Opens aInputStreamon theDSSDocumentcontents.voidsetBytes(byte[] bytes)-
Methods inherited from class eu.europa.esig.dss.model.CommonDocument
getAbsolutePath, getDigest, getMimeType, getName, save, setAbsolutePath, setMimeType, setName, toString, writeTo
-
-
-
-
Constructor Detail
-
InMemoryDocument
public InMemoryDocument()
-
InMemoryDocument
public InMemoryDocument(byte[] bytes)
Creates dss document that retains the data in memory- Parameters:
bytes- array of bytes representing the document
-
InMemoryDocument
public InMemoryDocument(byte[] bytes, String name)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
public InMemoryDocument(byte[] bytes, String name, MimeType mimeType)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
public InMemoryDocument(InputStream inputStream)
Creates dss document that retains the data in memory- Parameters:
inputStream- input stream representing the document
-
InMemoryDocument
public InMemoryDocument(InputStream inputStream, String name)
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
public InMemoryDocument(InputStream inputStream, String name, MimeType mimeType)
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 Detail
-
openStream
public InputStream openStream()
Description copied from interface:DSSDocumentOpens aInputStreamon theDSSDocumentcontents. The type of theInputStreamdepends on the type of theDSSDocument.- Returns:
- an
InputStream
-
getBytes
public byte[] getBytes()
-
setBytes
public void setBytes(byte[] bytes)
-
getBase64Encoded
public String getBase64Encoded()
-
-