This project has moved. For the latest updates, please go here.

bug??

Jul 29, 2013 at 10:14 PM
Edited Jul 29, 2013 at 10:14 PM
in method "GSF.IO.Unmanaged.MemoryStreamCore.CopyTo"

I guess you miss updating the variable "position", I think the correct codes should be:
public void CopyTo(long position, IntPtr dest, int length)
        {
        TryAgain:

            IntPtr src;
            int validLength;
            ReadBlock(position, out src, out validLength);
            if (validLength < length)
            {
                Memory.Copy(src,dest,validLength);
                length -= validLength;
                dest += validLength;
                position += validLength;
                goto TryAgain;
            }
            Memory.Copy(src, dest, length);
        }
am I right?
Developer
Aug 6, 2013 at 12:17 AM
Thanks! I corrected this in our offline copy. We plan to check this in soon.