extract Blob Or Null from Cursor - Android Database

Android examples for Database:Cursor

Description

extract Blob Or Null from Cursor

Demo Code


//package com.java2s;

import android.database.Cursor;

public class Main {
    public static byte[] extractBlobOrNull(Cursor c, String columnName) {
        int columnIndex = c.getColumnIndex(columnName);
        return c.isNull(columnIndex) ? null : c.getBlob(columnIndex);
    }/*from   w  w  w .j  ava2  s .co m*/
}

Related Tutorials