src/main/java/io/reactivex/processors/BehaviorProcessor.java
public boolean offer(T t) {
        if (t == null) {
            onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources."));
            return true;
        }
        BehaviorSubscription<T>[] array = subscribers.get();

        for (BehaviorSubscription<T> s : array) {
            if (s.isFull()) {
                return false;
            }
        }

        Object o = NotificationLite.next(t);
        setCurrent(o);
        for (BehaviorSubscription<T> bs : array) {
            bs.emitNext(o, index);
        }
        return true;
    }
public boolean offer(T t) {
        if (t == null) {
            onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources."));
            return true;
        }
        BehaviorSubscription<T>[] array = subscribers.get();

        for (BehaviorSubscription<T> s : array) {
            if (s.isFull()) {
                return false;
            }
        }

        Object o = NotificationLite.next(t);
        setCurrent(o);
        for (BehaviorSubscription<T> bs : array) {
            bs.emitNext(o, index);
        }
        return true;
    }
public boolean offer ( T t ) { if ( t == null ) { onError ( new NullPointerException ( "onNext called with null. Null values are generally not allowed in 2.x operators and sources." ) ) ; return true ; } BehaviorSubscription < T > [ ] array = subscribers . get ( ) ; for ( BehaviorSubscription < T > s : array ) { if ( s . isFull ( ) ) { return false ; } } Object o = NotificationLite . next ( t ) ; setCurrent ( o ) ; for ( BehaviorSubscription < T > bs : array ) { bs . emitNext ( o , index ) ; } return true ; }
Tries to emit the item to all currently subscribed Subscribers if all of them
has requested some value, returns false otherwise.
<p>
This method should be called in a sequential manner just like the onXXX methods
of the PublishProcessor.
<p>
Calling with null will terminate the PublishProcessor and a NullPointerException
is signalled to the Subscribers.
<p>History: 2.0.8 - experimental
@param t the item to emit, not null
@return true if the item was emitted to all Subscribers
@since 2.2
Tries to emit the item to all currently subscribed Subscribers if all of them has requested some value returns false otherwise . <p > This method should be called in a sequential manner just like the onXXX methods of the PublishProcessor . <p > Calling with null will terminate the PublishProcessor and a NullPointerException is signalled to the Subscribers . <p > History : 2 . 0 . 8 - experimental