public TileBitmap executeJob(final MBTilesRendererJob rendererJob) {

        try {
            final InputStream inputStream = file.getTileAsBytes(rendererJob.tile.tileX, rendererJob.tile.tileY, rendererJob.tile.zoomLevel);

            final TileBitmap bitmap;
            if (inputStream == null) {
                bitmap = graphicFactory.createTileBitmap(rendererJob.tile.tileSize, rendererJob.hasAlpha);
            } else {
                bitmap = graphicFactory.createTileBitmap(inputStream, rendererJob.tile.tileSize, rendererJob.hasAlpha);
                bitmap.scaleTo(rendererJob.tile.tileSize, rendererJob.tile.tileSize);
            }
            bitmap.setTimestamp(rendererJob.getDatabaseRenderer().getDataTimestamp(rendererJob.tile));
            return bitmap;
        } catch (Exception e) {
            Log.e("Error while rendering job " + rendererJob + ": " + e.getMessage());
            return null;
        }
    }
Called when a job needs to be executed.

@param rendererJob the job that should be executed.
main/src/main/java/cgeo/geocaching/unifiedmap/layers/mbtiles/MBTilesRenderer.java