|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.io.AbstractWireFormat
org.codehaus.activemq.io.impl.DefaultWireFormat
Default implementation used for Java-Java protocols. When talking to non-Java nodes we may use a different wire format.
Field Summary | |
static int |
WIRE_FORMAT_VERSION
Current wire format version for this implementation |
Constructor Summary | |
DefaultWireFormat()
Default Constructor |
Method Summary | |
boolean |
canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version |
WireFormat |
copy()
Creates a new copy of this wire format so it can be used in another thread/context |
int |
getCurrentWireFormatVersion()
|
Packet |
readPacket(DataInput in)
Reads a packet from the given input stream |
protected Packet |
readPacket(DataInput dataIn,
PacketReader reader)
|
Packet |
readPacket(int firstByte,
DataInput dataIn)
A helper method for working with sockets where the first byte is read first, then the rest of the message is read. |
void |
setCurrentWireFormatVersion(int version)
set the current version |
byte[] |
toBytes(Packet packet)
A helper method which converts a packet into a byte array Overrides the WireFormat to make use of the internal BytesOutputStream |
void |
writePacket(Packet packet,
DataOutput dataOut)
Write a Packet to a DataOutput |
protected void |
writePacket(Packet packet,
DataOutput dataOut,
PacketWriter writer)
|
Methods inherited from class org.codehaus.activemq.io.AbstractWireFormat |
fromBytes, fromBytes, initiateProtocol, readPacket, writePacket |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WIRE_FORMAT_VERSION
Constructor Detail |
public DefaultWireFormat()
Method Detail |
public WireFormat copy()
WireFormat
copy
in interface WireFormat
public Packet readPacket(DataInput in) throws IOException
WireFormat
readPacket
in interface WireFormat
in
-
IOException
public Packet readPacket(int firstByte, DataInput dataIn) throws IOException
WireFormat
readPacket
in interface WireFormat
firstByte
- dataIn
-
IOException
public void writePacket(Packet packet, DataOutput dataOut) throws IOException
writePacket
in interface WireFormat
packet
- dataOut
-
IOException
public byte[] toBytes(Packet packet) throws IOException
toBytes
in interface WireFormat
toBytes
in class AbstractWireFormat
packet
-
IOException
public boolean canProcessWireFormatVersion(int version)
canProcessWireFormatVersion
in interface WireFormat
version
- the version number to test
public int getCurrentWireFormatVersion()
getCurrentWireFormatVersion
in interface WireFormat
public void setCurrentWireFormatVersion(int version)
version
- protected final void writePacket(Packet packet, DataOutput dataOut, PacketWriter writer) throws IOException
IOException
protected final Packet readPacket(DataInput dataIn, PacketReader reader) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |