Class BinaryDocument
package: src.net.jxta.impl.document
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
BinaryDocument(byte [] someBytes)
   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
sendToStream(OutputStream stream)
   Returns a stream of bytes which represent the content of this Document.
 
Field Detail
myTypes
private final static MimeMediaType [] myTypes = { MimeMediaType.AOS }
Our Mime Media Type

ourBytes
private byte [] ourBytes = null
Storage for our bytes.
Constructor Detail
BinaryDocument
public BinaryDocument(byte [] someBytes)
Creates new BinaryDocument
Parameters:
someBytes Contains a byte array which will serve as our data.
Method Detail
getFileExtension
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

getMimeType
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.

getStream
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.

getSupportedMimeTypes
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.

sendToStream
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.