Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Bitmap; import java.security.InvalidParameterException; public class Main { /** * Performs some basic check-ups on a given bitmap picture. * * @param pictureBitmap The bitmap that must be checked */ public static void checkBitmap(Bitmap pictureBitmap) { if (pictureBitmap == null) { throw new NullPointerException("Picture bitmap cannot be null"); } if (pictureBitmap.getWidth() == 0 || pictureBitmap.getHeight() == 0) { throw new InvalidParameterException("Picture must have a valid size"); } } }