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, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asMap, exists, getContentEncoding, getContentType, getEarliestVersionCreateTime, getId, getMetadataUpdateTime, getProperty, getVersion, getVersionCreateTime
public DocumentImpl()
public DocumentImpl(Map<String,Object> metadata)
metadata
- to copypublic DocumentImpl(DocumentHeader header)
header
- to copypublic InputStream getInputStream()
Document
IContentRepository
.getInputStream
in interface Document
public Reader getReader() throws UnsupportedEncodingException
Document
IContentRepository
where
bytes are decoded to characters using the encoding identified by
DocumentHeader.getContentEncoding()
.getReader
in interface Document
UnsupportedEncodingException
public 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
- IOException
public void copyString(String encoding, String s) throws UnsupportedEncodingException
encoding
- The encoding that will be used to convert characters to bytes.s
- The string.UnsupportedEncodingException
public void copyReader(String encoding, Reader r) throws IOException
encoding
- The encoding that will be used to convert characters to bytes.r
- The reader.IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.