Author: alanmc
Date: 2008-02-14 16:09:14 -0500 (Thu, 14 Feb 2008)
New Revision: 95693

Modified:
   trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/PieceWriter/MemoryWriter.cs
Log:
Buffer 1MB by default. Made constructors public, fixed bug in writes

Modified: 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/PieceWriter/MemoryWriter.cs
===================================================================
--- 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/PieceWriter/MemoryWriter.cs   
    2008-02-14 20:59:54 UTC (rev 95692)
+++ 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/PieceWriter/MemoryWriter.cs   
    2008-02-14 21:09:14 UTC (rev 95693)
@@ -28,13 +28,13 @@
             }
         }
 
-        internal MemoryWriter(IPieceWriter writer)
-            : this(writer, 8 * 1024 * 1024)
+        public MemoryWriter(IPieceWriter writer)
+            : this(writer, 1 * 1024 * 1024)
         {
 
         }
 
-        internal MemoryWriter(IPieceWriter writer, int capacity)
+               public MemoryWriter(IPieceWriter writer, int capacity)
         {
             if (writer == null)
                 throw new ArgumentNullException("writer");
@@ -63,7 +63,7 @@
                 if (io != null)
                 {
                     int toCopy = Math.Min(count, io.Count + 
(int)(io.WriteOffset - offset));
-                    Buffer.BlockCopy(io.Buffer.Array, io.Buffer.Offset + 
(int)(io.WriteOffset - offset), buffer, io.Buffer.Offset + (origCount - count), 
toCopy);
+                    Buffer.BlockCopy(io.Buffer.Array, io.Buffer.Offset + 
(int)(io.WriteOffset - offset), buffer, bufferOffset + (origCount - count), 
toCopy);
                     offset += toCopy;
                     count -= toCopy;
                 }

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

Reply via email to