protected void validateImage ( BufferedImage image ) { // if the image is NULL, throw up if ( image == null ) throw new IllegalArgumentException ( "The passed image is NULL." ) ; // if image is not the correct type, throw up if ( image . getType ( ) != getImageType ( ) ) throw new IllegalArgumentException ( "The passed image is of type #" + image . getType ( ) + " but is required to be of BufferedImage type #" + getImageType ( ) + "." ) ; }
Test that the passed image is valid and conforms to the converters specifications .