docs: private void initFinalPositionAndOffset(BufferObjectDataInput in, ClassDefinition cd) {
          int fieldCount;
          try {
              // final position after portable is read
              finalPosition = in.readInt();
              fieldCount = in.readInt();
          } catch (IOException e) {
              throw new HazelcastSerializationException(e);
          }
          if (fieldCount != cd.getFieldCount()) {
              throw new IllegalStateException("Field count[" + fieldCount + "] in stream does not match " + cd);
          }
          offset = in.position();
      }