private static IEnumerable <byte> Iterate(this MemoryStream stream, TcpDataPiece src)
        {
            var buffer = stream.GetBuffer();

            for (var i = 0; i < stream.Length; i++)
            {
                yield return(buffer[i]);
            }

            foreach (var b in src.Iterate())
            {
                yield return(b);
            }
        }
 public static int GetSizeByMarker(this TcpDataPiece src, IReadOnlyList <byte> marker)
 {
     return(src.Iterate().GetSizeByMarker(marker));
 }
 public static int GetSizeByMarker(this MemoryStream stream, TcpDataPiece src, IReadOnlyList <byte> marker)
 {
     return(stream.Iterate(src).GetSizeByMarker(marker));
 }
示例#4
0
 public TcpDataReader(int readBufferSize)
 {
     _readBuffer = new TcpDataPiece(readBufferSize);
 }