public static async Task <WordList> ReadAsync(Stream dictionaryStream, AffixConfig affix, WordList.Builder builder = null) { using (var reader = new StaticEncodingLineReader(dictionaryStream, affix.Encoding)) { return(await ReadAsync(reader, affix, builder).ConfigureAwait(false)); } }
public static WordList Read(Stream dictionaryStream, AffixConfig affix, WordList.Builder builder = null) { using (var reader = new StaticEncodingLineReader(dictionaryStream, affix.Encoding)) { return(Read(reader, affix, builder)); } }
public static async Task <List <string> > ReadLinesAsync(string filePath, Encoding defaultEncoding) { using (var stream = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) using (var reader = new StaticEncodingLineReader(stream, defaultEncoding)) { return(await reader.ReadLinesAsync().ConfigureAwait(false)); } }
public static List <string> ReadLines(string filePath, Encoding defaultEncoding) { using (var stream = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) using (var reader = new StaticEncodingLineReader(stream, defaultEncoding)) { return(reader.ReadLines().ToList()); } }