code: public void initStream(Number streamId) {
          IConnection conn = Red5.getConnectionLocal();
          log.info("initStream stream id: {} current stream id: {} connection: {}", streamId, conn.getStreamId(), conn.getSessionId());
          if (conn instanceof IStreamCapableConnection) {
              ((IStreamCapableConnection) conn).reserveStreamId(streamId);
              IClientStream stream = ((IStreamCapableConnection) conn).getStreamById(streamId);
              if (stream != null) {
                  if (stream instanceof IClientBroadcastStream) {
                      IClientBroadcastStream bs = (IClientBroadcastStream) stream;
                      IBroadcastScope bsScope = getBroadcastScope(conn.getScope(), bs.getPublishedName());
                      if (bsScope != null && conn instanceof BaseConnection) {
                          ((BaseConnection) conn).unregisterBasicScope(bsScope);
                      }
                  }
                  stream.close();
              }
              ((IStreamCapableConnection) conn).deleteStreamById(streamId);
          } else {
              log.warn("ERROR in initStream, connection is not stream capable");
          }
      }
docs: {@inheritDoc}