|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.document.BinaryDocument
public class BinaryDocument
This class is an implementation of the Document interface. It is perhaps the simplest implementation of the Document interface possible.
Constructor Summary | |
---|---|
BinaryDocument(byte[] someBytes)
Creates new BinaryDocument from a byte array. |
|
BinaryDocument(byte[] someBytes,
MimeMediaType type)
Creates new BinaryDocument from a byte array. |
Method Summary | |
---|---|
String |
getFileExtension()
Returns the file extension type used by this Document . |
MimeMediaType |
getMimeType()
Returns the MIME Media type of this Document per
IETF RFC 2046 MIME : Media Types. |
InputStream |
getStream()
Returns the stream of bytes which represents the content of this Document . |
static MimeMediaType[] |
getSupportedMimeTypes()
Returns the MIME Media types supported by this this Document per IETF RFC 2046 MIME : Media Types. |
void |
sendToStream(OutputStream stream)
Send the contents of this Document to the specified stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryDocument(byte[] someBytes)
someBytes
- Contains a byte array which will serve as our data.public BinaryDocument(byte[] someBytes, MimeMediaType type)
someBytes
- Contains a byte array which will serve as our data.type
- The MIME media type for this document.Method Detail |
---|
public static MimeMediaType[] getSupportedMimeTypes()
public MimeMediaType getMimeType()
Document
per
IETF RFC 2046 MIME : Media Types.
JXTA does not currently support the 'Multipart
' or
'Message
' media types.
getMimeType
in interface Document
Document
.public String getFileExtension()
Document
. This
value is usually chosen based upon the MIME Media Type.
getFileExtension
in interface Document
Document
.public InputStream getStream() throws IOException
Document
.
getStream
in interface DocumentStreamIO
InputStream
containing the bytes
of this Document
.
IOException
- For errors while writing the Document
.public void sendToStream(OutputStream stream) throws IOException
Document
to the specified stream.
sendToStream
in interface DocumentStreamIO
stream
- The OutputStream to which the Document
will
be written.
IOException
- For errors while writing the Document
.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |