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
Class AbstractPacketReader

    java.lang.Object
      org.codehaus.activemq.message.AbstractPacketReader

All Implemented Interfaces:
  PacketReader

Direct Known Subclasses:
  ActiveMQMessageReader, BrokerInfoReader, CapacityInfoReader, CapacityInfoRequestReader, ConnectionInfoReader, ConsumerInfoReader, DurableUnsubscribeReader, MessageAckReader, ProducerInfoReader, ReceiptReader, SessionInfoReader, TransactionInfoReader, XATransactionInfoReader

public abstract class AbstractPacketReader
extends java.lang.Object
implements PacketReader

Allows instances implementing Packet interface to be deserailized

Version:
  $Revision: 1.6 $

Constructor Summary
`AbstractPacketReader()`

Method Summary
`void` | `buildPacket(Packet packet, java.io.DataInput dataIn)` build a Packet instance from the data input stream
`boolean` | `canRead(int packetType)`
`protected java.lang.Object` | `readObject(java.io.DataInput dataIn)` ;
`Packet` | `readPacketFromByteArray(byte[] data)` Deserailizes a Packet from a byte array
`protected java.lang.String` | `readUTF(java.io.DataInput dataIn)` pointless method - but mirrors writer

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.codehaus.activemq.message.PacketReader
`createPacket, getPacketType`

Constructor Detail

### AbstractPacketReader

    public AbstractPacketReader()

Method Detail

### canRead

    public boolean canRead(int packetType)

  Specified by:
    `canRead` in interface `PacketReader`
  Parameters:
    `packetType` -
  Returns:
    true if this PacketReader can a Packet of this type

### readUTF

    protected java.lang.String readUTF(java.io.DataInput dataIn)
                                throws java.io.IOException

  pointless method - but mirrors writer

  Parameters:
    `dataIn` -
  Returns:
    the String
  Throws:
    `java.io.IOException`

### readObject

    protected java.lang.Object readObject(java.io.DataInput dataIn)
                                   throws java.io.IOException

  ;

  Parameters:
    `dataIn` -
  Returns:
    object
  Throws:
    `java.io.IOException`

### buildPacket

    public void buildPacket(Packet packet,
                            java.io.DataInput dataIn)
                     throws java.io.IOException

  build a Packet instance from the data input stream

  Specified by:
    `buildPacket` in interface `PacketReader`
  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

  Specified by:
    `readPacketFromByteArray` in interface `PacketReader`
  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.