// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace Microsoft.Framework.WebEncoders { public static class Extensions { public static string[] ReadAllLines(this TextReader reader) { return ReadAllLinesImpl(reader).ToArray(); } private static IEnumerable ReadAllLinesImpl(TextReader reader) { string line; while ((line = reader.ReadLine()) != null) { yield return line; } } } }