public static AffixConfig Read(Stream stream, AffixConfig.Builder builder = null) { using (var reader = new DynamicEncodingLineReader(stream, DefaultEncoding)) { return(Read(reader, builder)); } }
public static async Task <AffixConfig> ReadAsync(Stream stream, AffixConfig.Builder builder = null) { using (var reader = new DynamicEncodingLineReader(stream, DefaultEncoding)) { return(await ReadAsync(reader, builder).ConfigureAwait(false)); } }
public static async Task <List <string> > ReadLinesAsync(string filePath, Encoding defaultEncoding) { using (var stream = FileStreamEx.OpenAsyncReadFileStream(filePath)) using (var reader = new DynamicEncodingLineReader(stream, defaultEncoding)) { return(await reader.ReadLinesAsync().ConfigureAwait(false)); } }
public static List <string> ReadLines(string filePath, Encoding defaultEncoding) { using (var stream = FileStreamEx.OpenReadFileStream(filePath)) using (var reader = new DynamicEncodingLineReader(stream, defaultEncoding)) { return(reader.ReadLines().ToList()); } }
public static async Task <IEnumerable <string> > ReadLinesAsync(string filePath, Encoding defaultEncoding) { if (filePath == null) { throw new ArgumentNullException(nameof(filePath)); } using (var stream = FileStreamEx.OpenAsyncReadFileStream(filePath)) using (var reader = new DynamicEncodingLineReader(stream, defaultEncoding ?? Encoding.UTF8)) { return(await reader.ReadLinesAsync().ConfigureAwait(false)); } }
public static List <string> ReadLines(string filePath, Encoding defaultEncoding) { if (filePath == null) { throw new ArgumentNullException(nameof(filePath)); } using (var stream = FileStreamEx.OpenReadFileStream(filePath)) using (var reader = new DynamicEncodingLineReader(stream, defaultEncoding ?? Encoding.UTF8)) { return(reader.ReadLines().ToList()); } }