in src/Serilog.Sinks.AzureDataExplorer/Durable/APayloadReader.cs [91:115]
private static bool TryReadLine(Stream current, ref long nextStart, out string nextLine)
{
var includesBom = nextStart == 0;
if (current.Length <= nextStart)
{
nextLine = null;
return false;
}
current.Position = nextStart;
// Important not to dispose this StreamReader as the stream must remain open.
var reader = new StreamReader(current, Encoding.UTF8, false, 128);
nextLine = reader.ReadLine();
if (nextLine == null)
return false;
nextStart += Encoding.UTF8.GetByteCount(nextLine) + Encoding.UTF8.GetByteCount(Environment.NewLine);
if (includesBom)
nextStart += 3;
return true;
}