internal static int GetChars(NativeBuffer buffer, int valueOffset, int lengthOffset, MetaType metaType, OracleConnection connection, bool boundAsUCS2, int sourceOffset, char[] destinationBuffer, int destinationOffset, int charCount)
        {
            bool success = false;

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                buffer.DangerousAddRef(ref success);
                if (boundAsUCS2)
                {
                    if (!metaType.IsLong)
                    {
                        Marshal.Copy(buffer.DangerousGetDataPtrWithBaseOffset(valueOffset + (System.Data.Common.ADP.CharSize * sourceOffset)), destinationBuffer, destinationOffset, charCount);
                        return(charCount);
                    }
                    NativeBuffer_LongColumnData.CopyOutOfLineChars(buffer.ReadIntPtr(valueOffset), sourceOffset, destinationBuffer, destinationOffset, charCount);
                    return(charCount);
                }
                string str    = MarshalToString(buffer, valueOffset, lengthOffset, metaType, connection, boundAsUCS2, false);
                int    length = str.Length;
                int    num    = ((sourceOffset + charCount) > length) ? (length - sourceOffset) : charCount;
                Buffer.BlockCopy(str.ToCharArray(sourceOffset, num), 0, destinationBuffer, destinationOffset * System.Data.Common.ADP.CharSize, num * System.Data.Common.ADP.CharSize);
                charCount = num;
            }
            finally
            {
                if (success)
                {
                    buffer.DangerousRelease();
                }
            }
            return(charCount);
        }
 internal static int GetChars(NativeBuffer buffer, int valueOffset, int lengthOffset, MetaType metaType, OracleConnection connection, bool boundAsUCS2, int sourceOffset, char[] destinationBuffer, int destinationOffset, int charCount)
 {
     bool success = false;
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         buffer.DangerousAddRef(ref success);
         if (boundAsUCS2)
         {
             if (!metaType.IsLong)
             {
                 Marshal.Copy(buffer.DangerousGetDataPtrWithBaseOffset(valueOffset + (System.Data.Common.ADP.CharSize * sourceOffset)), destinationBuffer, destinationOffset, charCount);
                 return charCount;
             }
             NativeBuffer_LongColumnData.CopyOutOfLineChars(buffer.ReadIntPtr(valueOffset), sourceOffset, destinationBuffer, destinationOffset, charCount);
             return charCount;
         }
         string str = MarshalToString(buffer, valueOffset, lengthOffset, metaType, connection, boundAsUCS2, false);
         int length = str.Length;
         int num = ((sourceOffset + charCount) > length) ? (length - sourceOffset) : charCount;
         Buffer.BlockCopy(str.ToCharArray(sourceOffset, num), 0, destinationBuffer, destinationOffset * System.Data.Common.ADP.CharSize, num * System.Data.Common.ADP.CharSize);
         charCount = num;
     }
     finally
     {
         if (success)
         {
             buffer.DangerousRelease();
         }
     }
     return charCount;
 }