24 lines
625 B
C#
24 lines
625 B
C#
using System.Text;
|
|
|
|
namespace SQLLinter.Infrastructure.Parser
|
|
{
|
|
public static class ParsingUtility
|
|
{
|
|
public static TextReader CreateTextReaderFromString(string str)
|
|
{
|
|
var bytes = Encoding.UTF8.GetBytes(str);
|
|
return new StreamReader(new MemoryStream(bytes));
|
|
}
|
|
|
|
public static Stream GenerateStreamFromString(string s)
|
|
{
|
|
var stream = new MemoryStream();
|
|
var writer = new StreamWriter(stream);
|
|
writer.Write(s);
|
|
writer.Flush();
|
|
stream.Position = 0;
|
|
return stream;
|
|
}
|
|
}
|
|
}
|