{code}
PDataType.INTEGER.getCodec().encodeInt(lengthBuf, 0, null);
ptr.set(lengthBuf);
{code}
I thought doing this way is changing the ptr itself. Thought that is not the right way to do.