org.red5.server.net.rtmp.message

## Class Packet

- java.lang.Object
- - org.red5.server.net.rtmp.message.Packet

All Implemented Interfaces:
  Externalizable, Serializable

    public class Packet
    extends Object
    implements Externalizable

RTMP packet. Consists of packet header, data and event context.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Packet()`
`Packet(Header header)` Create packet with given header
`Packet(Header header, IRTMPEvent event)` Create packet with given header and event context

### Method Summary

Methods
`org.apache.mina.core.buffer.IoBuffer` `getData()` Getter for data
`Header` `getHeader()` Getter for header
`IRTMPEvent` `getMessage()` Getter for event context
`void` `readExternal(ObjectInput in)`
`void` `setData(org.apache.mina.core.buffer.IoBuffer data)` Setter for data
`void` `setMessage(IRTMPEvent message)` Setter for event context
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Packet

    public Packet()

#### Packet

    public Packet(Header header)

Create packet with given header

Parameters:
  `header` - Packet header

#### Packet

    public Packet(Header header,
          IRTMPEvent event)

Create packet with given header and event context

Parameters:
  `header` - RTMP header
  `event` - RTMP message

### Method Detail

#### getHeader

    public Header getHeader()

Getter for header

Returns:
  Packet header

#### setMessage

    public void setMessage(IRTMPEvent message)

Setter for event context

Parameters:
  `message` - RTMP event context

#### getMessage

    public IRTMPEvent getMessage()

Getter for event context

Returns:
  RTMP event context

#### setData

    public void setData(org.apache.mina.core.buffer.IoBuffer data)

Setter for data

Parameters:
  `data` - Packet data

#### getData

    public org.apache.mina.core.buffer.IoBuffer getData()

Getter for data

Returns:
  Packet data

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`