@Override public DefaultDataBuffer slice(int index, int length) { checkIndex(index, length); int oldPosition = this.byteBuffer.position(); // Explicit access via Buffer base type for compatibility // with covariant return type on JDK 9's ByteBuffer... Buffer buffer = this.byteBuffer; try { buffer.position(index); ByteBuffer slice = this.byteBuffer.slice(); // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) slice).limit(length); return new SlicedDefaultDataBuffer(slice, this.dataBufferFactory, length); } finally { buffer.position(oldPosition); } }
@Override public DefaultDataBuffer slice(int index, int length) { checkIndex(index, length); int oldPosition = this.byteBuffer.position(); // Explicit access via Buffer base type for compatibility // with covariant return type on JDK 9's ByteBuffer... Buffer buffer = this.byteBuffer; try { buffer.position(index); ByteBuffer slice = this.byteBuffer.slice(); // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) slice).limit(length); return new SlicedDefaultDataBuffer(slice, this.dataBufferFactory, length); } finally { buffer.position(oldPosition); } }
@Override public DefaultDataBuffer slice(int index, int length) { checkIndex(index, length); int oldPosition = this.byteBuffer.position(); // Explicit access via Buffer base type for compatibility // with covariant return type on JDK 9's ByteBuffer... Buffer buffer = this.byteBuffer; try { buffer.position(index); ByteBuffer slice = this.byteBuffer.slice(); // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) slice).limit(length); return new SlicedDefaultDataBuffer(slice, this.dataBufferFactory, length); } finally { buffer.position(oldPosition); } }
SlicedDefaultDataBuffer(ByteBuffer byteBuffer, DefaultDataBufferFactory dataBufferFactory, int length) { super(dataBufferFactory, byteBuffer); writePosition(length); }
SlicedDefaultDataBuffer(ByteBuffer byteBuffer, DefaultDataBufferFactory dataBufferFactory, int length) { super(dataBufferFactory, byteBuffer); writePosition(length); }
SlicedDefaultDataBuffer(ByteBuffer byteBuffer, DefaultDataBufferFactory dataBufferFactory, int length) { super(dataBufferFactory, byteBuffer); writePosition(length); }
@Override public DefaultDataBuffer slice(int index, int length) { checkIndex(index, length); int oldPosition = this.byteBuffer.position(); // Explicit access via Buffer base type for compatibility // with covariant return type on JDK 9's ByteBuffer... Buffer buffer = this.byteBuffer; try { buffer.position(index); ByteBuffer slice = this.byteBuffer.slice(); // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) slice).limit(length); return new SlicedDefaultDataBuffer(slice, this.dataBufferFactory, length); } finally { buffer.position(oldPosition); } }
SlicedDefaultDataBuffer(ByteBuffer byteBuffer, DefaultDataBufferFactory dataBufferFactory, int length) { super(dataBufferFactory, byteBuffer); writePosition(length); }