提交 382c98f9 编写于 作者: R Rossen Stoyanchev

Remove isolated use of Reactor Buffer

上级 df80ffbf
...@@ -25,7 +25,6 @@ import org.apache.commons.logging.Log; ...@@ -25,7 +25,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.reactivestreams.Subscriber; import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription; import org.reactivestreams.Subscription;
import reactor.io.buffer.Buffer;
import org.springframework.util.Assert; import org.springframework.util.Assert;
...@@ -88,9 +87,10 @@ public class ResponseBodySubscriber implements WriteListener, Subscriber<ByteBuf ...@@ -88,9 +87,10 @@ public class ResponseBodySubscriber implements WriteListener, Subscriber<ByteBuf
if (ready) { if (ready) {
if (this.buffer != null) { if (this.buffer != null) {
output.write(new Buffer(this.buffer).asBytes()); byte[] bytes = new byte[this.buffer.remaining()];
this.buffer.get(bytes);
this.buffer = null; this.buffer = null;
output.write(bytes);
if (!subscriberComplete) { if (!subscriberComplete) {
this.subscription.request(1); this.subscription.request(1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册