List of usage examples for org.springframework.core.io.buffer DataBuffer write
DataBuffer write(byte[] source, int offset, int length);
From source file:org.springframework.http.server.reactive.ServletServerHttpRequest.java
/** * Read from the request body InputStream and return a DataBuffer. * Invoked only when {@link ServletInputStream#isReady()} returns "true". *//* ww w. ja v a 2 s . c o m*/ @Nullable protected DataBuffer readFromInputStream() throws IOException { int read = this.request.getInputStream().read(this.buffer); if (logger.isTraceEnabled()) { logger.trace("InputStream read returned " + read + (read != -1 ? " bytes" : "")); } if (read > 0) { DataBuffer dataBuffer = this.bufferFactory.allocateBuffer(read); dataBuffer.write(this.buffer, 0, read); return dataBuffer; } return null; }