@CanIgnoreReturnValue
    @Override
    public synchronized SeekableByteBufferChannel position(long newPosition)
        throws ClosedChannelException {
      checkIsOpen();
      if (newPosition < 0) {
        throw new IllegalArgumentException("negative position");
      }
      if (newPosition > buffer.limit()) {
        newPosition = buffer.limit();
      }
      buffer.position((int) newPosition);
      return this;
    }
Implements a SeekableByteChannel for testing.

<p>The implementation is backed by a ByteBuffer.
java_src/src/main/java/com/google/crypto/tink/testing/StreamingTestUtil.java