mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 17:09:05 +00:00
Polishing.
This commit is contained in:
+2
-6
@@ -47,12 +47,8 @@ public class ByteBufferEncoder extends AbstractEncoder<ByteBuffer> {
|
||||
public Flux<DataBuffer> encode(Publisher<? extends ByteBuffer> inputStream,
|
||||
DataBufferAllocator allocator, ResolvableType type, MimeType mimeType,
|
||||
Object... hints) {
|
||||
//noinspection unchecked
|
||||
return Flux.from(inputStream).map(byteBuffer -> {
|
||||
DataBuffer dataBuffer = allocator.allocateBuffer(byteBuffer.remaining());
|
||||
dataBuffer.write(byteBuffer);
|
||||
return dataBuffer;
|
||||
});
|
||||
|
||||
return Flux.from(inputStream).map(allocator::wrap);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user