Author: thomasvm
Date: 2007-03-27 00:28:13 -0500 (Tue, 27 Mar 2007)
New Revision: 75006

Modified:
   trunk/facebook-sharp/ChangeLog
   trunk/facebook-sharp/src/Mono.Facebook/Util.cs
Log:
2007-03-27 George Talusan <[EMAIL PROTECTED]>
        * src/Mono.Facebook/Util.cs: fix the way the response stream is read,
        the old implementation sometimes caused the deserialization to fail


Modified: trunk/facebook-sharp/ChangeLog
===================================================================
--- trunk/facebook-sharp/ChangeLog      2007-03-27 05:22:50 UTC (rev 75005)
+++ trunk/facebook-sharp/ChangeLog      2007-03-27 05:28:13 UTC (rev 75006)
@@ -1,3 +1,7 @@
+2007-03-27 George Talusan <[EMAIL PROTECTED]>
+       * src/Mono.Facebook/Util.cs: fix the way the response stream is read,
+       the old implementation sometimes caused the deserialization to fail
+
 2007-03-16 Thomas Van Machelen <[EMAIL PROTECTED]>
        * src/Mono.Facebook/Tag.cs: remove ugly characters
 

Modified: trunk/facebook-sharp/src/Mono.Facebook/Util.cs
===================================================================
--- trunk/facebook-sharp/src/Mono.Facebook/Util.cs      2007-03-27 05:22:50 UTC 
(rev 75005)
+++ trunk/facebook-sharp/src/Mono.Facebook/Util.cs      2007-03-27 05:28:13 UTC 
(rev 75006)
@@ -157,15 +157,10 @@
                        try
                        {
                                response = request.GetResponse ();
-                               Stream response_stream = 
response.GetResponseStream ();
-
-                               List<byte> byte_list = new List<byte>();
-                               int b;
-
-                               while ((b = response_stream.ReadByte ()) != -1)
-                                       byte_list.Add ((byte)b);
-
-                               return byte_list.ToArray ();
+                               using (StreamReader reader = new 
StreamReader(response.GetResponseStream(), Encoding.UTF8))
+                               {
+                                       return 
Encoding.UTF8.GetBytes(reader.ReadToEnd());
+                               }
                        }
                        finally
                        {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to