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. |
static net.jxta.document.MimeMediaType[] |
getSupportedMimeTypes()
Returns the MIME Media types supported by this 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.
getSupportedMimeTypes
public static net.jxta.document.MimeMediaType[] getSupportedMimeTypes()
- Returns the MIME Media types supported by this this Document per
.
Jxta does not currently support the 'Multipart' or 'Message' media types.
- Returns:
- An array of MimeMediaType objects 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.