private function calculateSizeOfRemainingLengthField(int $size): int
    {
        $blockSize = $iterations = 0;
        while ($size >= $blockSize) {
            $iterations++;
            $blockSize = 128 ** $iterations;
        }

        $this->sizeOfRemainingLengthField = $iterations;
        return $iterations;
    }