/* (non-Javadoc)
  * @see java.lang.Object#toString()
  */
 @Override
 public String toString() {
   StringBuilder sb = new StringBuilder("Packet [");
   if (header != null) {
     sb.append(
         "[header data type="
             + header.getDataType()
             + ", channel="
             + header.getChannelId()
             + ", timer="
             + header.getTimer()
             + "]");
   } else {
     sb.append("[header=null]");
   }
   if (message != null) {
     sb.append(", [message timestamp=" + message.getTimestamp() + "]");
   } else {
     sb.append(", [message=null]");
   }
   sb.append("]");
   return sb.toString();
 }
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   header = (Header) in.readObject();
   message = (IRTMPEvent) in.readObject();
   message.setHeader(header);
   message.setTimestamp(header.getTimer());
 }
 /**
  * Create packet with given header
  *
  * @param header Packet header
  */
 public Packet(Header header) {
   this.header = header;
   data = ByteBuffer.allocate(header.getSize() + (header.getTimer() == 0xffffff ? 4 : 0));
 }