org.activemq.io.impl
Interface PacketWriter

All Known Implementing Classes:
AbstractPacketMarshaller, AbstractPacketWriter

public interface PacketWriter

Allows instances implementing Packet to written to a DataOutput


Method Summary
 boolean canWrite(Packet packet)
           
 int getPacketType()
          Return the type of Packet
 int getWireFormatVersion()
           
 void setWireFormatVersion(int version)
          Set the wire format version
 void writePacket(Packet packet, DataOutput dataOut)
          Write a Packet instance to data output stream
 byte[] writePacketToByteArray(Packet packet)
          Serializes a Packet int a byte array
 

Method Detail

getPacketType

public int getPacketType()
Return the type of Packet

Returns:
integer representation of the type of Packet

canWrite

public boolean canWrite(Packet packet)
Parameters:
packet -
Returns:
true if this PacketWriter can write this type of Packet

writePacket

public void writePacket(Packet packet,
                        DataOutput dataOut)
                 throws IOException
Write a Packet instance to data output stream

Parameters:
packet - the instance to be seralized
dataOut - the output stream
Throws:
IOException - thrown if an error occurs

writePacketToByteArray

public byte[] writePacketToByteArray(Packet packet)
                              throws IOException
Serializes a Packet int a byte array

Parameters:
packet -
Returns:
the byte[]
Throws:
IOException

setWireFormatVersion

public void setWireFormatVersion(int version)
Set the wire format version

Parameters:
version -

getWireFormatVersion

public int getWireFormatVersion()
Returns:
the wire format version


Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.