Polish
This commit is contained in:
parent
c3a8bf4d17
commit
a712f43654
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.BlockingQueue;
|
||||||
|
|
||||||
import org.reactivestreams.Publisher;
|
import org.reactivestreams.Publisher;
|
||||||
import org.reactivestreams.Subscription;
|
import org.reactivestreams.Subscription;
|
||||||
import reactor.rx.Streams;
|
import reactor.rx.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code InputStream} implementation based on a byte array {@link Publisher}.
|
* {@code InputStream} implementation based on a byte array {@link Publisher}.
|
||||||
|
|
@ -60,7 +60,7 @@ public class ByteBufferPublisherInputStream extends InputStream {
|
||||||
public ByteBufferPublisherInputStream(Publisher<ByteBuffer> publisher, int requestSize) {
|
public ByteBufferPublisherInputStream(Publisher<ByteBuffer> publisher, int requestSize) {
|
||||||
Assert.notNull(publisher, "'publisher' must not be null");
|
Assert.notNull(publisher, "'publisher' must not be null");
|
||||||
|
|
||||||
this.queue = Streams.from(publisher).toBlockingQueue(requestSize);
|
this.queue = Stream.from(publisher).toBlockingQueue(requestSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ import javax.xml.bind.Unmarshaller;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import reactor.Flux;
|
||||||
import reactor.Mono;
|
import reactor.Mono;
|
||||||
import reactor.io.buffer.Buffer;
|
import reactor.io.buffer.Buffer;
|
||||||
import reactor.rx.Streams;
|
|
||||||
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.util.BufferOutputStream;
|
import org.springframework.util.BufferOutputStream;
|
||||||
|
|
@ -73,7 +73,7 @@ public class XmlHandler implements HttpHandler {
|
||||||
bos.close();
|
bos.close();
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
|
|
||||||
return response.setBody(Streams.just(buffer.byteBuffer()));
|
return response.setBody(Flux.just(buffer.byteBuffer()));
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
logger.error(ex, ex);
|
logger.error(ex, ex);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue