net.jxta.impl.document
Class BinaryDocument
java.lang.Object
|
+--net.jxta.impl.document.BinaryDocument
- public class BinaryDocument
- extends java.lang.Object
- implements net.jxta.document.Document
This class is an implementation of the Document interface. It is perhaps the
simplest implementation of the Document interface possible.
- Since:
- jxta 0.2
Constructor Summary |
BinaryDocument(byte[] someBytes)
Creates new BinaryDocument |
Method Summary |
net.jxta.document.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. |
java.lang.String |
getType()
Returns the MIME Media type of this Document per
. |
void |
sendToStream(java.io.OutputStream stream)
Returns a stream of bytes which represent the content of this Document. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
BinaryDocument
public BinaryDocument(byte[] someBytes)
- Creates new BinaryDocument
- Parameters:
someBytes
- Contains a byte array which will serve as our data.
getType
public java.lang.String getType()
- Returns the MIME Media type of this Document per
. Note that the mime type
returned may provide additional information about the encoding used or
format of the data stream for this document. For Documents who's type was
not determinable, the default media types 'Text/Plain' or
'Application/Octet-Stream' may be returned.
Jxta does not currently support the 'Multipart' or 'Message' media types.
- Returns:
- A string containing the MIME Media Type for this Document.
getMimeType
public net.jxta.document.MimeMediaType getMimeType()
- Returns the MIME Media type of this Document per
. Prefered to
getType
because it returns a richer set of information.
Jxta does not currently support the 'Multipart' or 'Message' media types.
- Specified by:
- getMimeType in interface net.jxta.document.Document
- Returns:
- A MimeMediaType object containing the MIME Media Type for this Document.
getStream
public java.io.InputStream getStream()
throws java.io.IOException
- Returns a stream of bytes which represent the content of this Document.
- Specified by:
- getStream in interface net.jxta.document.Document
- Returns:
- An
InputStream
containting the bytes of this Document.
sendToStream
public void sendToStream(java.io.OutputStream stream)
throws java.io.IOException
- Returns a stream of bytes which represent the content of this Document.
- Specified by:
- sendToStream in interface net.jxta.document.Document
- Returns:
- An
InputStream
containting the bytes of this Document.