[Mono-devel-list] Npgsql patch for binary types

Daniel Morgan danielmorgan at verizon.net
Thu Oct 23 18:57:45 EDT 2003


The latest code for npgsql is in the npgsql cvs at sourceforge.net.
Whenever a release happens to npgsql, it gets copied over to mono cvs.
The purpose of putting it into mono cvs is to make last minute fixes for
building and running Npgsql on mono for a mono release.

The same goes for ByteFX.Data MySQL client.  It exists in Mono cvs only for
fixes for building and running ByteFX.Data MySQL client on a Mono release.
The latest code for ByteFX.Data MySQL client exists in ByteFX.Data's cvs at
sourceforge.net.

-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com]On Behalf Of Jackson
Harper
Sent: Thursday, October 23, 2003 5:45 PM
To: Francisco Figueiredo Jr.
Cc: 'Mono-Devel-List; npgsql-hackers at svr3.postgresql.org
Subject: Re: [Mono-devel-list] Npgsql patch for binary types


Hello,

> This is the implementation which we already have in cvs:
>

  I couldn't find this implementation in the mcs CVS. Is it possible
that it has not been updated yet? I did spend some time optimizing this
method this morning and got some pretty good results. Here is my
optimized version:

private static String A (Byte[] byteArray)
{
	int len = byteArray.Length;
        char[] res = new char [len * 5];

        for (int i = 0; i <len; i++) {
        	res [(i*5)] = '\\';
                res [(i*5)+1] = '\\';
                res [(i*5)+2] = (char) (((byteArray[i] & 0xC0) >> 6) +
'0');
                res [(i*5)+3] = (char) (((byteArray[i] & 0x38) >> 3) +
'0');
                res [(i*5)+4] = (char) ((byteArray[i] & 0x07) + '0');
       }

       return new String (res);
}

Here is a little test case (play with MaxSize):
http://primates.ximian.com/~jackson/f.cs

Cheers,
Jackson


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list