public void SetResponseBodyString(string body) { if (!RequestLocked) { throw new Exception("You cannot call this function before request is made to server."); } if (ResponseBody == null) { GetResponseBody(); } var bodyBytes = ResponseEncoding.GetBytes(body); SetResponseBody(bodyBytes); }
private void ReadText(Stream stream, Byte[] bytes) { String CurrentLine = ""; Byte[] bb = null; StringReader sr = new StringReader(this.ResponseEncoding.GetString(bytes)); while (true) { CurrentLine = sr.ReadLine(); if (CurrentLine == null) { break; } bb = ResponseEncoding.GetBytes(CurrentLine + MailParser.NewLine); stream.Write(bb, 0, bb.Length); } }
private void ReadText(Stream stream, Byte[] bytes) //I duota streama uzraso baitu array { String CurrentLine = ""; //+ Byte[] bb = null; //+ StringReader sr = new StringReader(this.ResponseEncoding.GetString(bytes)); //String readeris su uzkoduotu bytes array while (true) { CurrentLine = sr.ReadLine(); //+ if (CurrentLine == null) { break; } //+ bb = ResponseEncoding.GetBytes(CurrentLine + MailParser.NewLine); //+ stream.Write(bb, 0, bb.Length); //Raso i streama duomenys } }