In corlib/System.Runtime.InteropServices:
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / FirebirdSql.Data.Common / BinaryEncoding.cs
index 9581ea4fcec21545b4c93e3730ced6a3fac57178..46debc58a409e81e29d813d99819942aa0adc962 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
  *  BinaryEncoding handler for .Net.  This class implements
  *     a symmetric encoding that will convert string to byte[]
  *  and byte[] to string without any character set
@@ -18,15 +18,15 @@ namespace FirebirdSql.Data.Common
        {
                #region Static Methods
 
-        public static string BytesToString(byte[] byteArray)
-        {
-            // This code isn't great because it requires a double copy,
-            // but it requires unsafe code to solve the problem efficiently.
-            char[] charArray = new char[byteArray.GetLength(0)];
-            Array.Copy(byteArray, charArray, byteArray.Length);
+               public static string BytesToString(byte[] byteArray)
+               {
+                       // This code isn't great because it requires a double copy,
+                       // but it requires unsafe code to solve the problem efficiently.
+                       char[] charArray = new char[byteArray.GetLength(0)];
+                       Array.Copy(byteArray, charArray, byteArray.Length);
 
-            return new string(charArray);
-        }
+                       return new string(charArray);
+               }
 
                static void Validate(object data, int dataLength, int index, int count)
                {
@@ -130,11 +130,15 @@ namespace FirebirdSql.Data.Common
                        return count;
                }
 
-               public override string GetString(byte[] bytes)
+#if (!NETCF)
+       
+        public override string GetString(byte[] bytes)
                {
                        return BytesToString(bytes);
                }
 
+#endif
+
                public override string GetString(byte[] bytes, int index, int count)
                {
                        Validate(bytes, bytes.Length, index, count);