class GraphicsUtils
{
    private static final Logger Log = LoggerFactory.getLogger( GraphicsUtils.class );

    /**
     * Checks if the provided input stream represents an image.
     *
     * @param stream The data to be parsed. Cannot be null.
     * @return true if the provided data is successfully identified as an image, otherwise false.
     */
    public static boolean isImage( final InputStream stream )
    {<FILL_FUNCTION_BODY>}

    /**
     * Checks if the provided byte array represents an image.
     *
     * @param bytes The data to be parsed. Cannot be null.
     * @return true if the provided data is successfully identified as an image, otherwise false.
     */
    public static boolean isImage( final byte[] bytes )
    {
        if ( bytes == null )
        {
            throw new IllegalArgumentException( "Argument 'bytes' cannot be null." );
        }
        return isImage( new ByteArrayInputStream( bytes ) );
    }
}

        try
        {
            // This attempts to read the bytes as an image, returning null if it cannot parse the bytes as an image.
            return null != ImageIO.read( stream );
        }
        catch ( IOException e )
        {
            Log.debug( "An exception occurred while determining if data represents an image.", e );
            return false;
        }
    
<no_super_class>