[Mono-dev] BitConverter differences

Gert Driesen gert.driesen at telenet.be
Sat Jul 21 02:44:25 EDT 2007


Jae,
 
I'll take care of this, and add more unit tests.
 
Thanks for the report.
 
Gert

  _____  

From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Jae Stutzman
Sent: vrijdag 20 juli 2007 22:14
To: mono-devel-list at lists.ximian.com
Subject: [Mono-dev] BitConverter differences


Observe the following snippet:

byte[] test = { 3, 15, 3, 2, 5, 6, 4, 3 };
string value = BitConverter.ToString(test, 4, 0);
Console.WriteLine(value);

On MS the BitConverter.ToString returns an empty string if the (third param)
length is 0, on mono it throws a: 

Unhandled Exception: System.ArgumentOutOfRangeException: capacity must be
greater than zero.
Parameter name: capacity
-1
  at System.Text.StringBuilder..ctor (System.String value, Int32 startIndex,
Int32 length, Int32 capacity) [0x00000] 
  at System.Text.StringBuilder..ctor (Int32 capacity) [0x00000] 
  at System.BitConverter.ToString (System.Byte[] value, Int32 startIndex,
Int32 length) [0x00000] 


Known? Expected?

I don't want to annoy on the list, so you can stop me anytime. 

Jae

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070721/b34b0a96/attachment.html 


More information about the Mono-devel-list mailing list