@Override
    public String readString() throws IOException {
        final int length = readRawVarInt32();
        if (length < 0) {
            throw ProtocolException.negativeSize();
        }

        if (nioBuffer.remaining() < length) {
            throw ProtocolException.misreportedSize();
        }

        final int position = nioBuffer.position();
        String result;
        if (nioBuffer.hasArray()) {
            if (UnsafeUtil.hasUnsafe()) {
                BufferUtils.position(nioBuffer, position + length);
                result = UnsafeUtf8Util.decodeUtf8(nioBuffer.array(), nioBuffer.arrayOffset() + position, length);
            } else {
                BufferUtils.position(nioBuffer, position + length);
                result = StringSerializer.STRING.deser(nioBuffer.array(), nioBuffer.arrayOffset() + position, length);
            }
        } else {
            if (UnsafeUtil.hasUnsafe()) {
                BufferUtils.position(nioBuffer, position + length);
                result = UnsafeUtf8Util.decodeUtf8Direct(nioBuffer, position, length);
            } else {
                final byte[] tmp = new byte[length];
                nioBuffer.get(tmp);
                result = StringSerializer.STRING.deser(tmp);
            }
        }
        return result;
    }
Read an {@code sint64} field value from the internal buffer.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/serialization/impl/protostuff/io/NioBufInput.java