Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.message
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, java.io.DataInput dataIn)` build a Packet instance from the data input stream
`boolean` | `canRead(int packetType)`
`Packet` | `createPacket()`
`int` | `getPacketType()` Return the type of Packet
`Packet` | `readPacketFromByteArray(byte[] data)` Deserailizes a Packet from a byte array

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,
                            java.io.DataInput dataIn)
                     throws java.io.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:
    `java.io.IOException`

### readPacketFromByteArray

    public Packet readPacketFromByteArray(byte[] data)
                                   throws java.io.IOException

  Deserailizes a Packet from a byte array

  Parameters:
    `data` -
  Returns:
    the deserialized Packet
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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