|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.io.impl.AbstractPacketReader
org.activemq.io.impl.AbstractPacketMarshaller
public abstract class AbstractPacketMarshaller
Field Summary | |
---|---|
protected int |
wireFormatVersion
|
Constructor Summary | |
---|---|
AbstractPacketMarshaller()
|
Method Summary | |
---|---|
boolean |
canWrite(Packet packet)
|
int |
getWireFormatVersion()
|
protected ActiveMQDestination |
readDestination(DataInput dataIn)
Reads a destination from the input stream |
void |
setWireFormatVersion(int version)
Set the wire format version |
protected void |
writeDestination(ActiveMQDestination destination,
DataOutput dataOut)
Writes the given destination to the stream |
protected void |
writeObject(Object object,
DataOutput dataOut)
Simple (but inefficent) utility method to write an object on to a stream |
void |
writePacket(Packet p,
DataOutput dataOut)
Write a Packet instance to data output stream |
byte[] |
writePacketToByteArray(Packet packet)
Serializes a Packet int a byte array |
protected void |
writeUTF(String str,
DataOutput dataOut)
simple helper method to ensure null strings are catered for |
Methods inherited from class org.activemq.io.impl.AbstractPacketReader |
---|
buildPacket, canRead, readObject, readPacketFromByteArray, readUTF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.activemq.io.impl.PacketWriter |
---|
getPacketType |
Methods inherited from interface org.activemq.io.impl.PacketReader |
---|
createPacket, getPacketType |
Field Detail |
---|
protected int wireFormatVersion
Constructor Detail |
---|
public AbstractPacketMarshaller()
Method Detail |
---|
protected void writeUTF(String str, DataOutput dataOut) throws IOException
str
- dataOut
-
IOException
protected ActiveMQDestination readDestination(DataInput dataIn) throws IOException
IOException
protected void writeDestination(ActiveMQDestination destination, DataOutput dataOut) throws IOException
IOException
public boolean canWrite(Packet packet)
canWrite
in interface PacketWriter
packet
-
protected void writeObject(Object object, DataOutput dataOut) throws IOException
object
- dataOut
-
IOException
public byte[] writePacketToByteArray(Packet packet) throws IOException
writePacketToByteArray
in interface PacketWriter
packet
-
IOException
public void writePacket(Packet p, DataOutput dataOut) throws IOException
writePacket
in interface PacketWriter
p
- the instance to be seralizeddataOut
- the output stream
IOException
- thrown if an error occurspublic void setWireFormatVersion(int version)
setWireFormatVersion
in interface PacketReader
setWireFormatVersion
in interface PacketWriter
setWireFormatVersion
in class AbstractPacketReader
version
- public int getWireFormatVersion()
getWireFormatVersion
in interface PacketReader
getWireFormatVersion
in interface PacketWriter
getWireFormatVersion
in class AbstractPacketReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |