/// <summary> /// Parses the specified source as a CSV file where the separator is specified and might not be a comma. /// <para> /// This overload allows the separator to be controlled. /// For example, a tab-separated file is very similar to a CSV file, the only difference is the separator. /// </para> /// <para> /// This method opens the CSV file for reading. /// The caller is responsible for closing it by calling <seealso cref="#close()"/>. /// /// </para> /// </summary> /// <param name="source"> the file resource </param> /// <param name="headerRow"> whether the source has a header row, an empty source must still contain the header </param> /// <param name="separator"> the separator used to separate each field, typically a comma, but a tab is sometimes used </param> /// <returns> the CSV file </returns> /// <exception cref="UncheckedIOException"> if an IO exception occurs </exception> /// <exception cref="IllegalArgumentException"> if the file cannot be parsed </exception> public static CsvIterator of(CharSource source, bool headerRow, char separator) { ArgChecker.notNull(source, "source"); //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("resource") java.io.BufferedReader reader = com.opengamma.strata.collect.Unchecked.wrap(() -> source.openBufferedStream()); StreamReader reader = Unchecked.wrap(() => source.openBufferedStream()); return(create(reader, headerRow, separator)); }