org.codehaus.activemq.io.impl
Interface PacketReader

All Known Implementing Classes:
AbstractPacketReader

public interface PacketReader

Allows instances implementing Packet to read from a DataOutputStream


Method Summary
 void buildPacket(Packet packet, DataInput dataIn)
          build a Packet instance from the data input stream
 boolean canRead(int packetType)
           
 Packet createPacket()
           
 int getPacketType()
          Return the type of Packet
 int getWireFormatVersion()
           
 Packet readPacketFromByteArray(byte[] data)
          Deserailizes a Packet from a byte array
 void setWireFormatVersion(int version)
          Set the wire format version
 

Method Detail

getPacketType

public int getPacketType()
Return the type of Packet

Returns:
integer representation of the type of Packet

canRead

public boolean canRead(int packetType)
Parameters:
packetType -
Returns:
true if this PacketReader can a Packet of this type

createPacket

public Packet createPacket()
Returns:
a new Packet instance

buildPacket

public void buildPacket(Packet packet,
                        DataInput dataIn)
                 throws IOException
build a Packet instance from the data input stream

Parameters:
packet - A Packet object
dataIn - the data input stream to build the packet from
Throws:
IOException

readPacketFromByteArray

public Packet readPacketFromByteArray(byte[] data)
                               throws IOException
Deserailizes a Packet from a byte array

Parameters:
data -
Returns:
the deserialized Packet
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-2005 Protique, Ltd.. All Rights Reserved.