Hi In my last email I managed to not copy-paste the last line of the function so there is the complete function:
public string ReadLine (){ CheckOpen(); List<byte> bytes_read = new List<byte>(); byte[] buff = new byte[1]; int new_line_offset = 0; while(true) { //int n = stream.Read(buff, 0, 1); int n = FackeRead(buff); if(n == -1) { break; } bytes_read.Add(buff[0]); if(bytes_read.Count >= new_line.Length) { bool isNewLine = true; //check if we have read a NewLine string. for(int i = 0; i < new_line.Length; i++) { if(bytes_read[new_line_offset + i] != new_line[i]) { isNewLine = false; break; } } if(isNewLine) { //Remove the NewLine string from the read line. bytes_read.RemoveRange(new_line_offset, new_line.Length); break; } new_line_offset++; } } return new String(encoding.GetChars(bytes_read.ToArray())); } Regards, Michael Mattess
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list