Project JXTA

net.jxta.impl.endpoint
Class WireFormatMessageBinary

java.lang.Object
  extended by net.jxta.impl.endpoint.WireFormatMessageBinary
All Implemented Interfaces:
Document, WireFormatMessage

public class WireFormatMessageBinary
extends Object
implements WireFormatMessage

A Wire Format Message which encodes the message into Mime Type "application/x-jxta-msg".

This implementation does nothing with encodings.

This implemenation does not use any mime parameters attached to the requesting mime type.

See Also:
WireFormatMessageFactory, JXTA Protocols Specification : Binary Message Format

Nested Class Summary
(package private) static class WireFormatMessageBinary.binaryElementProxy
           
(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
           
 
Method Summary
 boolean equals(Object obj)
          
 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()
          
 MimeMediaType getMimeType()
          
 InputStream getStream()
          
 int hashCode()
          
 void sendToStream(OutputStream sendTo)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HAS_TYPE

protected static final byte HAS_TYPE
See Also:
Constant Field Values

HAS_ENCODING

protected static final byte HAS_ENCODING
See Also:
Constant Field Values

HAS_SIGNATURE

protected static final byte HAS_SIGNATURE
See Also:
Constant Field Values

MESSAGE_VERSION

protected static final int MESSAGE_VERSION
See Also:
Constant Field Values

INSTANTIATOR

public static final WireFormatMessageFactory.Instantiator INSTANTIATOR
Our instantiator for the factory.

Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getFileExtension

public String getFileExtension()

Specified by:
getFileExtension in interface Document

getMimeType

public MimeMediaType getMimeType()

Specified by:
getMimeType in interface Document

getStream

public InputStream getStream()
                      throws IOException

Specified by:
getStream in interface Document
Throws:
IOException

sendToStream

public void sendToStream(OutputStream sendTo)
                  throws IOException

Specified by:
sendToStream in interface Document
Throws:
IOException

getByteLength

public long getByteLength()
Returns the size of the serialized and encoded form of the message in bytes.

Specified by:
getByteLength in interface WireFormatMessage
Returns:
long the size of the serialized and encoded message in bytes.

getContentEncoding

public MimeMediaType getContentEncoding()
Returns the encoding used for this content. May be null for unencoded (raw) content.

Specified by:
getContentEncoding in interface WireFormatMessage
Returns:
the encoding used for this message.

JXTA J2SE