code: private void write(IRTMPEvent event, Number streamId) {
          log.trace("write to stream id: {} channel: {}", streamId, id);
          final Header header = new Header();
          final Packet packet = new Packet(header, event);
          // set the channel id
          header.setChannelId(id);
          int ts = event.getTimestamp();
          if (ts != 0) {
              header.setTimer(event.getTimestamp());
          }
          header.setStreamId(streamId);
          header.setDataType(event.getDataType());
          // should use RTMPConnection specific method.. 
          //log.trace("Connection type for write: {}", connection.getClass().getName());
          connection.write(packet);
      }
docs: Writes packet from event data to RTMP connection and stream id.
  
  @param event
  Event data
  @param streamId
  Stream id