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 AbstractPacketWriter

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

All Implemented Interfaces:
  PacketWriter

Direct Known Subclasses:
  ActiveMQMessageWriter, BrokerInfoWriter, CapacityInfoRequestWriter, CapacityInfoWriter, ConnectionInfoWriter, ConsumerInfoWriter, DurableUnsubscribeWriter, MessageAckWriter, ProducerInfoWriter, ReceiptWriter, SessionInfoWriter, TransactionInfoWriter, XATransactionInfoWriter

public abstract class AbstractPacketWriter
extends java.lang.Object
implements PacketWriter

Allows instances implementing Packet interface to be serailized/deserailized

Constructor Summary
`AbstractPacketWriter()`

Method Summary
`boolean` | `canWrite(Packet packet)`
`protected void` | `writeObject(java.lang.Object object, java.io.DataOutput dataOut)` Simple (but inefficent) utility method to write an object on to a stream
`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
`protected void` | `writeUTF(java.lang.String str, java.io.DataOutput dataOut)` simple helper method to ensure null strings are catered for

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.PacketWriter
`getPacketType`

Constructor Detail

### AbstractPacketWriter

    public AbstractPacketWriter()

Method Detail

### writeUTF

    protected void writeUTF(java.lang.String str,
                            java.io.DataOutput dataOut)
                     throws java.io.IOException

  simple helper method to ensure null strings are catered for

  Parameters:
    `str` -
    `dataOut` -
  Throws:
    `java.io.IOException`

### canWrite

    public boolean canWrite(Packet packet)

  Specified by:
    `canWrite` in interface `PacketWriter`
  Parameters:
    `packet` -
  Returns:
    true if this PacketWriter can write this type of Packet

### writeObject

    protected void writeObject(java.lang.Object object,
                               java.io.DataOutput dataOut)
                        throws java.io.IOException

  Simple (but inefficent) utility method to write an object on to a stream

  Parameters:
    `object` -
    `dataOut` -
  Throws:
    `java.io.IOException`

### writePacketToByteArray

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

  Serializes a Packet int a byte array

  Specified by:
    `writePacketToByteArray` in interface `PacketWriter`
  Parameters:
    `packet` -
  Returns:
    the byte[]
  Throws:
    `java.io.IOException`

### writePacket

    public void writePacket(Packet packet,
                            java.io.DataOutput dataOut)
                     throws java.io.IOException

  Write a Packet instance to data output stream

  Specified by:
    `writePacket` in interface `PacketWriter`
  Parameters:
    `packet` - the instance to be seralized
    `dataOut` - the output stream
  Throws:
    `java.io.IOException` - thrown if an error occurs

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.