Align InputStreamSubscriber copies
There are legitimate differences, but also some are fixes that should be on both sides. See gh-31677
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
package org.springframework.core.io.buffer;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.reactivestreams.Subscriber;
|
||||
import org.reactivestreams.Subscription;
|
||||
import org.springframework.lang.Nullable;
|
||||
import reactor.core.Exceptions;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -18,6 +12,14 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.reactivestreams.Subscriber;
|
||||
import org.reactivestreams.Subscription;
|
||||
import reactor.core.Exceptions;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Bridges between {@link Publisher Publisher<DataBuffer>} and {@link InputStream}.
|
||||
*
|
||||
@@ -73,6 +75,8 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
|
||||
@Override
|
||||
public void onNext(DataBuffer t) {
|
||||
Assert.notNull(t, "DataBuffer must not be null");
|
||||
|
||||
if (this.done) {
|
||||
discard(t);
|
||||
return;
|
||||
@@ -351,5 +355,4 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user