code: public void deleteStream(IStreamCapableConnection conn, Number streamId) {
          IClientStream stream = 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();
          }
          conn.unreserveStreamId(streamId);
      }
docs: {@inheritDoc}