dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO MemoryStream.cs,1.


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO MemoryStream.cs,1.10,1.11
Date: Mon, 12 May 2003 04:55:56 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO
In directory subversions:/tmp/cvs-serv32469/runtime/System/IO

Modified Files:
        MemoryStream.cs 
Log Message:
Patch #1457 from Thong Nyguen


Index: MemoryStream.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/MemoryStream.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** MemoryStream.cs     10 Jun 2002 04:14:15 -0000      1.10
--- MemoryStream.cs     12 May 2003 08:55:53 -0000      1.11
***************
*** 6,9 ****
--- 6,10 ----
   * Contributed by Stephen Compall <address@hidden>.
   * Contributions by Haran Shivanan <address@hidden>
+  * Contributions by Thong Nguyen <address@hidden>
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 44,47 ****
--- 45,49 ----
  
  using System;
+ using System.IO;
  
  public class MemoryStream : Stream
***************
*** 65,69 ****
  
        // from StringBuilder
!       private const int defaultCapacity = 16;
  
        // constructors.
--- 67,72 ----
  
        // from StringBuilder
!       // Thong says:  Made default to 0 to match MS & Mono.
!       private const int defaultCapacity = 0;
  
        // constructors.
***************
*** 479,485 ****
                if (minNewLength > impl_buffer.Length)
                {
!                       long realNewLength = Length;
!                       while (minNewLength > realNewLength) // x1.5 until ready
!                               realNewLength += ((int)realNewLength) >> 1;
                        byte[] new_buffer = new byte[(int)realNewLength];
                        Array.Copy(impl_buffer, new_buffer, topLimit);
--- 482,488 ----
                if (minNewLength > impl_buffer.Length)
                {
!                       int realNewLength = Math.Max(impl_buffer.Length, 1024);
!                       while (minNewLength > realNewLength)
!                               realNewLength = realNewLength * 2; // double 
the buffer size.
                        byte[] new_buffer = new byte[(int)realNewLength];
                        Array.Copy(impl_buffer, new_buffer, topLimit);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]