code: public IoBuffer encodeHeader(Header header, Header lastHeader) {
          final IoBuffer result = IoBuffer.allocate(calculateHeaderSize(header, lastHeader));
          encodeHeader(header, lastHeader, result);
          return result;
      }
docs: Encode RTMP header.
  
  @param header
  RTMP message header
  @param lastHeader
  Previous header
  @return Encoded header data