Example #1
0
        protected byte[] GetByteArrayValue(string propertyName)
        {
            Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted");

            int    bufferSize;
            IntPtr buffer;

            if (NativeTable.get_binary(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)_rowHandle.RowIndex, out buffer, out bufferSize) != IntPtr.Zero)
            {
                var bytes = new byte[bufferSize];
                Marshal.Copy(buffer, bytes, 0, bufferSize);
                return(bytes);
            }

            return(null);
        }