public class DocumentImpl extends DocumentHeaderImpl implements Document
log| Constructor and Description |
|---|
DocumentImpl()
Create a new empty document.
|
DocumentImpl(DocumentHeader header)
Copy constructor for header information.
|
DocumentImpl(Map<String,Object> metadata)
Copy constructor for header information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyReader(String encoding,
Reader r)
Set the content by copying characters from the given reader and
converting them into bytes using the specified encoding.
|
void |
copyStream(byte[] b)
Set the content by copying the byte[].
|
void |
copyStream(byte[] b,
int off,
int len)
Set the content by copying the byte[].
|
void |
copyStream(InputStream is)
Set the content by copying the given stream.
|
void |
copyString(String encoding,
String s)
Set the content by converting characters to into bytes using the
specified encoding.
|
InputStream |
getInputStream()
An input stream on the byte[] stored in the
IContentRepository. |
Reader |
getReader()
A reader on the byte[] stored in the
IContentRepository where
bytes are decoded to characters using the encoding identified by
DocumentHeader.getContentEncoding(). |
asMap, exists, getContentEncoding, getContentType, getEarliestVersionCreateTime, getId, getMetadataUpdateTime, getProperty, getVersion, getVersionCreateTime, setContentEncoding, setContentType, setId, setPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasMap, exists, getContentEncoding, getContentType, getEarliestVersionCreateTime, getId, getMetadataUpdateTime, getProperty, getVersion, getVersionCreateTimepublic DocumentImpl()
public DocumentImpl(Map<String,Object> metadata)
metadata - to copypublic DocumentImpl(DocumentHeader header)
header - to copypublic InputStream getInputStream()
DocumentIContentRepository.getInputStream in interface Documentpublic Reader getReader() throws UnsupportedEncodingException
DocumentIContentRepository where
bytes are decoded to characters using the encoding identified by
DocumentHeader.getContentEncoding().getReader in interface DocumentUnsupportedEncodingExceptionpublic void copyStream(byte[] b,
int off,
int len)
Note: Do NOT use this when the content is character data since the encoding attribute will NOT be set.
b - The content.off - The offset of the 1st byte to be copied.len - The #of bytes to be copied.public void copyStream(byte[] b)
Note: Do NOT use this when the content is character data since the encoding attribute will NOT be set.
b - The content.public void copyStream(InputStream is) throws IOException
Note: Do NOT use this when the content is character data since the encoding attribute will NOT be set.
is - IOExceptionpublic void copyString(String encoding, String s) throws UnsupportedEncodingException
encoding - The encoding that will be used to convert characters to bytes.s - The string.UnsupportedEncodingExceptionpublic void copyReader(String encoding, Reader r) throws IOException
encoding - The encoding that will be used to convert characters to bytes.r - The reader.IOExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.