|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.WireFormatMessageBinary
public class WireFormatMessageBinary
A Wire Format Message which encodes the message into MIME Type "application/x-jxta-msg".
This implementation does nothing with encodings. This implementation does not use any MIME parameters attached to the requesting mime type.
WireFormatMessageFactory
,
JXTA Protocols Specification : Binary Message FormatNested Class Summary | |
---|---|
(package private) static class |
WireFormatMessageBinary.binaryElementProxy
Proxy for a message element. |
(package private) static class |
WireFormatMessageBinary.binaryMessageProxy
Internal representation for a binary format wire message. |
(package private) static class |
WireFormatMessageBinary.Instantiator
Our instantiator. |
Field Summary | |
---|---|
protected static byte |
HAS_ENCODING
|
protected static byte |
HAS_SIGNATURE
|
protected static byte |
HAS_TYPE
|
static WireFormatMessageFactory.Instantiator |
INSTANTIATOR
Our instantiator for the factory. |
protected static int |
MESSAGE_VERSION
|
Constructor Summary | |
---|---|
WireFormatMessageBinary(Message msg,
MimeMediaType type,
MimeMediaType[] preferedContentEncodings)
Creates a new instance of WireFormatMessageBinary. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
ByteBuffer[] |
getByteBuffers()
Returns the Document as a sequence of ByteBuffers |
long |
getByteLength()
Returns the size of the serialized and encoded form of the message in bytes. |
MimeMediaType |
getContentEncoding()
Returns the encoding used for this content. |
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 . |
int |
hashCode()
|
void |
sendToStream(OutputStream sendTo)
Send the contents of this Document to the specified stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte HAS_TYPE
protected static final byte HAS_ENCODING
protected static final byte HAS_SIGNATURE
protected static final int MESSAGE_VERSION
public static final WireFormatMessageFactory.Instantiator INSTANTIATOR
Constructor Detail |
---|
WireFormatMessageBinary(Message msg, MimeMediaType type, MimeMediaType[] preferedContentEncodings) throws IOException
msg
- the message being serializedtype
- the mime mediatype being requested.preferedContentEncodings
- The ranked content encodings preferred by
the recipient.
IOException
- if an io error occursMethod Detail |
---|
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String getFileExtension()
Document
. This
value is usually chosen based upon the MIME Media Type.
getFileExtension
in interface Document
Document
.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 InputStream getStream() throws IOException
Document
.
getStream
in interface DocumentStreamIO
InputStream
containing the bytes
of this Document
.
IOException
- For errors while writing the Document
.public ByteBuffer[] getByteBuffers()
Document
as a sequence of ByteBuffers
getByteBuffers
in interface DocumentByteBufferIO
public void sendToStream(OutputStream sendTo) throws IOException
Document
to the specified stream.
sendToStream
in interface DocumentStreamIO
sendTo
- The OutputStream to which the Document
will
be written.
IOException
- For errors while writing the Document
.public long getByteLength()
getByteLength
in interface WireFormatMessage
public MimeMediaType getContentEncoding()
null
for
unencoded (raw) content.
getContentEncoding
in interface WireFormatMessage
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |