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 DefaultWireFormat

    java.lang.Object
      org.codehaus.activemq.message.WireFormat
          org.codehaus.activemq.message.DefaultWireFormat

All Implemented Interfaces:
  java.io.Serializable

public class DefaultWireFormat
extends WireFormat
implements java.io.Serializable

Default implementation used for Java-Java protocols. When talking to non-Java nodes we may use a different wire format.

Version:
  $Revision: 1.13 $
See Also:
  Serialized Form

Constructor Summary
`DefaultWireFormat()` Default Constructor

Method Summary
`WireFormat` | `copy()` Creates a new copy of this wire format so it can be used in another thread/context
`Packet` | `readPacket(java.io.DataInput in)` Reads a packet from the given input stream
`protected Packet` | `readPacket(java.io.DataInput dataIn, PacketReader reader)`
`Packet` | `readPacket(int firstByte, java.io.DataInput dataIn)` A helper method for working with sockets where the first byte is read first, then the rest of the message is read.
`byte[]` | `toBytes(Packet packet)` A helper method which converts a packet into a byte array Overrides the WireFormat to make use of the internal BytesOutputStream
`void` | `writePacket(Packet packet, java.io.DataOutput dataOut)` Write a Packet to a DataOutput
`protected void` | `writePacket(Packet packet, java.io.DataOutput dataOut, PacketWriter writer)`

Methods inherited from class org.codehaus.activemq.message.WireFormat
`fromBytes, fromBytes, readPacket, writePacket`

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

Constructor Detail

### DefaultWireFormat

    public DefaultWireFormat()

  Default Constructor

Method Detail

### copy

    public WireFormat copy()

  Description copied from class: `WireFormat`
  Creates a new copy of this wire format so it can be used in another thread/context

  Specified by:
    `copy` in class `WireFormat`
  Returns:

### readPacket

    public Packet readPacket(java.io.DataInput in)
                      throws java.io.IOException

  Description copied from class: `WireFormat`
  Reads a packet from the given input stream

  Specified by:
    `readPacket` in class `WireFormat`
  Parameters:
    `in` -
  Returns:
  Throws:
    `java.io.IOException`

### readPacket

    public Packet readPacket(int firstByte,
                             java.io.DataInput dataIn)
                      throws java.io.IOException

  Description copied from class: `WireFormat`
  A helper method for working with sockets where the first byte is read first, then the rest of the message is read.

  Its common when dealing with sockets to have different timeout semantics until the first non-zero byte is read of a message, after which time a zero timeout is used.

  Specified by:
    `readPacket` in class `WireFormat`
  Parameters:
    `firstByte` - the first byte of the packet
    `dataIn` - the rest of the packet
  Returns:
  Throws:
    `java.io.IOException`

### writePacket

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

  Write a Packet to a DataOutput

  Specified by:
    `writePacket` in class `WireFormat`
  Parameters:
    `packet` -
    `dataOut` -
  Throws:
    `java.io.IOException`

### toBytes

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

  A helper method which converts a packet into a byte array Overrides the WireFormat to make use of the internal BytesOutputStream

  Overrides:
    `toBytes` in class `WireFormat`
  Parameters:
    `packet` -
  Returns:
    a byte array representing the packet using some wire protocol
  Throws:
    `java.io.IOException`

### writePacket

    protected final void writePacket(Packet packet,
                                     java.io.DataOutput dataOut,
                                     PacketWriter writer)
                              throws java.io.IOException

  Throws:
    `java.io.IOException`

### readPacket

    protected final Packet readPacket(java.io.DataInput dataIn,
                                      PacketReader reader)
                               throws java.io.IOException

  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.