storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvTableReader.java
public int importFromCsv(SQLiteDatabase db, InputStream is) {
		int numInserts = 0;
		db.beginTransaction();
		insertHelper = new DatabaseUtils.InsertHelper(db,
				th.getTableName());
		try {
			InputStreamReader isr = new InputStreamReader(is);
			BufferedReader reader = new BufferedReader(isr);
			String headerRow = reader.readLine();
			String csvRow = reader.readLine();
			while (csvRow != null) {
				long rowId = parseAndInsertRow(csvRow);
				if (rowId == -1L) {
					throw new RuntimeException("Error after row " + numInserts);
				}
				numInserts++;
				csvRow = reader.readLine();
			}
			db.setTransactionSuccessful();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			db.endTransaction();
		}
		return numInserts;
	}
public int importFromCsv(SQLiteDatabase db, InputStream is) {
		int numInserts = 0;
		db.beginTransaction();
		insertHelper = new DatabaseUtils.InsertHelper(db,
				th.getTableName());
		try {
			InputStreamReader isr = new InputStreamReader(is);
			BufferedReader reader = new BufferedReader(isr);
			String headerRow = reader.readLine();
			String csvRow = reader.readLine();
			while (csvRow != null) {
				long rowId = parseAndInsertRow(csvRow);
				if (rowId == -1L) {
					throw new RuntimeException("Error after row " + numInserts);
				}
				numInserts++;
				csvRow = reader.readLine();
			}
			db.setTransactionSuccessful();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			db.endTransaction();
		}
		return numInserts;
	}
Attempts to import a database table from an {@link InputStream}
formatted as a CSV file. Does all inserts in a single transaction
for efficiency and so that all inserts will succeed or fail
together.

@param db
@param is
@return count of rows imported or -1 if error