[mono-android] How to tell is Java.Lang.Object is byte[]

Jeremy A. Kolb - ARA/NED jkolb at ara.com
Mon Dec 17 18:45:41 UTC 2012


I'm trying to replicate DatabaseUtils.getTypeOfObject and am running into trouble telling it the object is a byte[].

The code in the android source is:

} else if (obj instanceof byte[]) {
            return Cursor.FIELD_TYPE_BLOB;

"obj is byte[]" doesn't work so I tried:

Type type = obj.GetType();
if (type.IsArray && type.GetElementType() == typeof(Java.Lang.Byte))
    return FieldType.Blob;

However type.IsArray fails.

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20121217/0c1c45e5/attachment.html>


More information about the Monodroid mailing list