private function toCsvLine(array $elements, $memory): string
    {
        ftruncate($memory, 0);
        rewind($memory);
        fputcsv($memory, $elements, $this->delimiter, $this->enclosure);
        rewind($memory);
        return stream_get_contents($memory);
    }