public class BinaryDocument
Implements:
Document
This class is an implementation of the Document interface. It is perhaps the
simplest implementation of the Document interface possible.
| Field Summary |
private final static MimeMediaType [] |
Our Mime Media Type |
private byte [] |
Storage for our bytes. |
| Constructor Summary |
public |
Creates new BinaryDocument |
| Method Summary |
public String |
Returns the file extension type used by this Document. |
public MimeMediaType |
Returns the MIME Media type of this Document per
. |
public InputStream |
Returns a stream of bytes which represent the content of this Document. |
public static MimeMediaType [] |
Returns the MIME Media types supported by this this Document per
. |
public void |
Returns a stream of bytes which represent the content of this Document. |
private final static MimeMediaType [] myTypes = {
MimeMediaType.AOS
}
Our Mime Media Type
private byte [] ourBytes = null
Storage for our bytes.
public BinaryDocument(byte [] someBytes)
Creates new BinaryDocument
Parameters:
someBytes Contains a byte array which will serve as our data.
public String getFileExtension()
Returns the file extension type used by this Document. This value
is chosen based upon the MIME Media Type for this Document.
Return:
a string containing an appropriate file extension
public MimeMediaType getMimeType()
Returns the MIME Media type of this Document per
.
Jxta does not currently support the 'Multipart' or 'Message' media types.
Return:
A MimeMediaType object containing the MIME Media Type for this Document.
public InputStream getStream()
Returns a stream of bytes which represent the content of this Document.
Throws:
IOException
Return:
An java.io.InputStream containting the bytes of this Document.
public static MimeMediaType [] getSupportedMimeTypes()
Returns the MIME Media types supported by this this Document per
.
Jxta does not currently support the 'Multipart' or 'Message' media types.
Return:
An array of MimeMediaType objects containing the MIME Media Type
for this Document.
public void sendToStream(OutputStream stream)
Returns a stream of bytes which represent the content of this Document.
Throws:
IOException
Return:
An java.io.InputStream containting the bytes of this Document.