|
|
|
|
@ -37,7 +37,6 @@ import org.springframework.util.ObjectUtils;
@@ -37,7 +37,6 @@ import org.springframework.util.ObjectUtils;
|
|
|
|
|
* @author Arjen Poutsma |
|
|
|
|
* @author Juergen Hoeller |
|
|
|
|
* @author Brian Clozel |
|
|
|
|
* @author Injae Kim |
|
|
|
|
* @since 5.0 |
|
|
|
|
* @see DefaultDataBufferFactory |
|
|
|
|
*/ |
|
|
|
|
@ -81,14 +80,16 @@ public class DefaultDataBuffer implements DataBuffer {
@@ -81,14 +80,16 @@ public class DefaultDataBuffer implements DataBuffer {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Directly exposes the native {@code ByteBuffer} that this buffer is based |
|
|
|
|
* on also updating the {@code ByteBuffer's} position and limit to match |
|
|
|
|
* the current {@link #readPosition()} and {@link #writePosition()}. |
|
|
|
|
* on. The {@linkplain ByteBuffer#position() position} of the returned |
|
|
|
|
* {@code ByteBuffer} is set to the {@linkplain #readPosition() read |
|
|
|
|
* position}, and the {@linkplain ByteBuffer#limit()} to the |
|
|
|
|
* {@linkplain #writePosition() write position}. |
|
|
|
|
* @return the wrapped byte buffer |
|
|
|
|
*/ |
|
|
|
|
public ByteBuffer getNativeBuffer() { |
|
|
|
|
this.byteBuffer.position(this.readPosition); |
|
|
|
|
this.byteBuffer.limit(this.writePosition); |
|
|
|
|
return this.byteBuffer; |
|
|
|
|
return this.byteBuffer.duplicate() |
|
|
|
|
.position(this.readPosition) |
|
|
|
|
.limit(this.writePosition); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setNativeBuffer(ByteBuffer byteBuffer) { |
|
|
|
|
|