Update of /cvsroot/mmclibrary/mmclibrary/MMCLib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3162/MMCLib
Modified Files:
ComStream.cs _ChangeLog.txt
Log Message:
Index: ComStream.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib/ComStream.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ComStream.cs 20 Dec 2003 20:32:16 -0000 1.1
--- ComStream.cs 9 Jun 2005 09:21:20 -0000 1.2
***************
*** 78,98 ****
}
! public override int Read([In,Out] byte[] buffer, int offset, int count) {
! byte[] buf = new byte[count];
! System.IntPtr lenPtr = new System.IntPtr();
this.comStream.Read(buf, count, lenPtr);
! int len = lenPtr.ToInt32();
! m_readCount += count;
System.Diagnostics.Debug.WriteLine("Read: " + m_readCount + " bytes of the requested: " + count + " bytes");
! int pos=0;
! //while(pos < len) {
! while(pos < count) {
! buffer[offset++] = buf[pos++];
! }
! //return lenPtr.ToInt32();
! return count;
}
! public override void SetLength(long value) {
this.comStream.SetSize(value);
}
--- 78,107 ----
}
! /// <summary>
! /// Reads a sequence of bytes from the current stream and advances the position within the stream
! /// by the number of bytes read.
! /// </summary>
! /// <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified
! /// byte array with the values between offset and (offset + count- 1) replaced by the bytes read from the
! /// current source.</param>
! /// <param name="offset">The zero-based byte offset in buffer at which to begin storing the data read
! /// from the current stream.</param>
! /// <param name="count">The maximum number of bytes to be read from the current stream.</param>
! /// <returns></returns>
! public override int Read([In,Out] byte[] buffer, int offset, int count)
! {
! byte[] buf = new byte[count];
! System.IntPtr lenPtr = Marshal.AllocCoTaskMem( 4 );
this.comStream.Read(buf, count, lenPtr);
! int len = Marshal.ReadInt32( lenPtr );
! Marshal.FreeCoTaskMem( lenPtr );
! m_readCount += len;
System.Diagnostics.Debug.WriteLine("Read: " + m_readCount + " bytes of the requested: " + count + " bytes");
! Array.Copy( buf, buffer, len );
! return len;
}
! public override void SetLength(long value)
! {
this.comStream.SetSize(value);
}
Index: _ChangeLog.txt
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib/_ChangeLog.txt,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** _ChangeLog.txt 2 Jun 2005 08:58:30 -0000 1.22
--- _ChangeLog.txt 9 Jun 2005 09:21:20 -0000 1.23
***************
*** 1,3 ****
--- 1,6 ----
ver 1.6.9
+ - Fixed:
+ ComStream kept reading forever (Thanks Peter Bertok)
+
- Applied patches:
[1201916 ] BaseNode.UpdateThisNode Improvement (Thanks to P. Di Gregorio)
|