📄 linereader.cs
字号:
namespace Imps.Base.Sipc
{
using System;
using System.IO;
using System.Text;
public class LineReader
{
private static char[] _newLine = new char[] { '\r', '\n' };
private MemoryStream _stream;
public void Bind(MemoryStream stream)
{
this._stream = stream;
}
public string ReadLine()
{
long position = this._stream.Position;
while (this._stream.Position < this._stream.Length)
{
if (((this._stream.ReadByte() == 13) && (this._stream.Position < this._stream.Length)) && (this._stream.ReadByte() == 10))
{
break;
}
}
long num2 = this._stream.Position;
if (num2 <= position)
{
return null;
}
string text = Encoding.UTF8.GetString(this._stream.GetBuffer(), (int) position, (int) (num2 - position));
if (text == null)
{
return null;
}
return text.TrimEnd(_newLine);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -