[Mono-bugs] [Bug 399959] New: BinaryReader : ReadChars problem

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 13 04:36:27 EDT 2008


           Summary: BinaryReader : ReadChars problem
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Keywords: Code
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mariodc at sydec.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

I am using Mono 1.9.1.
The problem is with the ReadChars function. All of a sudden it skips
more than it is supposed to. When I use ReadBytes, it works.
The ReadChars(64) is supposed to be on position 128, but it is on 136.

Here are the file and some test code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
   class Program

       static void Main(string[] args)
           int nrOfColumns = 0;
           Stream memoryStream = File.OpenRead("test.mix");
           BinaryReader reader = new BinaryReader(memoryStream);
           reader.BaseStream.Position = 0;
           char[] chars = reader.ReadChars(4);
           string identification = new string(chars);
           Console.Out.WriteLine("identification = " + identification);

           reader.BaseStream.Position = 40;
           nrOfColumns = reader.ReadInt32();
           reader.BaseStream.Position = 60;
           for (int i = 0; i < nrOfColumns; i++)
               char[] mixName = reader.ReadChars(64);
               //Console.Out.WriteLine(" mixName= " + new


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list