net.jxta.document
Interface Document
- All Known Subinterfaces:
- StructuredDocument, StructuredTextDocument, TextDocument
- public interface Document
This interface describes a Jxta document. The document class is polymorphic
based on what is encoded in the document. Jxta Codat objects are generally
invarient with respect to the values in the document.
Note : Document is intended to be somewhat analagous to HTTP streams
we don't provide for compression, encoding, etc. though and leave it all
up to the MIME media type and whatever parameters it may specify. Its not
clear if we should break this stuff or leave it as is.
- Since:
- JXTA 1.0
- See Also:
Document
,
StructuredDocument
,
StructuredTextDocument
Method Summary |
MimeMediaType |
getMimeType()
Returns the MIME Media type of this Document per
. |
java.io.InputStream |
getStream()
Returns a stream of bytes which represent the content of this Document. |
void |
sendToStream(java.io.OutputStream stream)
Rather than returning an InputStream like getStream , send the
document to the specified stream. |
getMimeType
public MimeMediaType getMimeType()
- Returns the MIME Media type of this Document per
.
Jxta does not currently support the 'Multipart' or 'Message' media types.
- Returns:
- A MimeMediaType object containing the MIME Media Type for this Document.
- Since:
- JXTA 1.0
getStream
public java.io.InputStream getStream()
throws java.io.IOException
- Returns a stream of bytes which represent the content of this Document.
- Returns:
- An
InputStream
containting the bytes of this Document. - Throws:
- java.io.IOException - if an I/O error occurs.
- Since:
- JXTA 1.0
sendToStream
public void sendToStream(java.io.OutputStream stream)
throws java.io.IOException
- Rather than returning an InputStream like
getStream
, send the
document to the specified stream.
- Parameters:
stream
- The OutputStream to which the document will be written.- Throws:
- java.io.IOException - if an I/O error occurs.
- Since:
- JXTA 1.0