protected function _setPartLine(array $contents, $line_index, $part, $action = 'replace')
    {
        if (property_exists($this, $part)) {
            if (is_null($line_index)) {
                end($this->{$part});
                $line_index = key($this->{$part})+1;
            } else {
                $line_index--;
            }
            if ($line_index<$this->getLineSize() && 'insert'===$action) {
                $table_part = $this->{$part};
                array_splice($table_part, $line_index, 0, array($this->_getPaddedLine($contents)));
                $this->{$part} = $table_part;
                $this->_repadAllLines();
            } else {
                $this->{$part}[$line_index] = $this->_getPaddedLine($contents);
            }
            $this->_parseTableSizes(true);
        } elseif (!in_array($part, self::$_table_parts)) {
            throw new InvalidArgumentException(
                sprintf('Unknown table part "%s"!', $part)
            );
        }
    }