Пример #1
0
 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));
     }
 }
Пример #2
0
 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));
     }
 }
Пример #3
0
 public static async Task <List <string> > ReadLinesAsync(string filePath, Encoding defaultEncoding)
 {
     using (var stream = FileStreamEx.OpenAsyncReadFileStream(filePath))
         using (var reader = new StaticEncodingLineReader(stream, defaultEncoding))
         {
             return(await reader.ReadLinesAsync().ConfigureAwait(false));
         }
 }
Пример #4
0
 public static List <string> ReadLines(string filePath, Encoding defaultEncoding)
 {
     using (var stream = FileStreamEx.OpenReadFileStream(filePath))
         using (var reader = new StaticEncodingLineReader(stream, defaultEncoding))
         {
             return(reader.ReadLines().ToList());
         }
 }
Пример #5
0
        public static async Task <IEnumerable <string> > ReadLinesAsync(string filePath, Encoding encoding)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }

            using (var stream = FileStreamEx.OpenAsyncReadFileStream(filePath))
                using (var reader = new StaticEncodingLineReader(stream, encoding))
                {
                    return(await reader.ReadLinesAsync().ConfigureAwait(false));
                }
        }
Пример #6
0
        public static List <string> ReadLines(string filePath, Encoding encoding)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }

            using (var stream = FileStreamEx.OpenReadFileStream(filePath))
                using (var reader = new StaticEncodingLineReader(stream, encoding))
                {
                    return(reader.ReadLines().ToList());
                }
        }