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 PacketWriter

All Known Implementing Classes:
  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
`void` | `writePacket(Packet packet, java.io.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,
                            java.io.DataOutput dataOut)
                     throws java.io.IOException

  Write a Packet instance to data output stream

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

### writePacketToByteArray

    public byte[] writePacketToByteArray(Packet packet)
                                  throws java.io.IOException

  Serializes a Packet int a byte array

  Parameters:
    `packet` -
  Returns:
    the byte[]
  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.