|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.bfs.DocumentHeaderImpl
com.bigdata.bfs.DocumentImpl
public class DocumentImpl
Flyweight document implementation.
| Field Summary |
|---|
| Fields inherited from class com.bigdata.bfs.DocumentHeaderImpl |
|---|
log |
| Constructor Summary | |
|---|---|
DocumentImpl()
Create a new empty document. |
|
DocumentImpl(DocumentHeader header)
Copy constructor for header information. |
|
DocumentImpl(Map<String,Object> metadata)
Copy constructor for header information. |
|
| Method Summary | |
|---|---|
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(). |
| Methods inherited from class com.bigdata.bfs.DocumentHeaderImpl |
|---|
asMap, exists, getContentEncoding, getContentType, getEarliestVersionCreateTime, getId, getMetadataUpdateTime, getProperty, getVersion, getVersionCreateTime, setContentEncoding, setContentType, setId, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bigdata.bfs.DocumentHeader |
|---|
asMap, exists, getContentEncoding, getContentType, getEarliestVersionCreateTime, getId, getMetadataUpdateTime, getProperty, getVersion, getVersionCreateTime |
| Constructor Detail |
|---|
public DocumentImpl()
public DocumentImpl(Map<String,Object> metadata)
metadata - to copypublic DocumentImpl(DocumentHeader header)
header - to copy| Method Detail |
|---|
public InputStream getInputStream()
DocumentIContentRepository.
getInputStream in interface Document
public Reader getReader()
throws UnsupportedEncodingException
DocumentIContentRepository where
bytes are decoded to characters using the encoding identified by
DocumentHeader.getContentEncoding().
getReader in interface DocumentUnsupportedEncodingException
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||