} else if ( _oOutputIdentifier instanceof String ) { FileOutputStream fos = null; try { fos = new FileOutputStream( (String) _oOutputIdentifier ); bw = new BmpWriter( _img ); bw.write( fos ); fos.close( ); } catch ( Exception ex ) { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, ex ); } } else { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, "exception.unable.write.output.identifier", new Object[]{ _oOutputIdentifier }, ResourceBundle.getBundle( Messages.DEVICE_EXTENSION, getLocale( ) ) );
	public final void after( ) throws ChartException	{		try		{			super.after( );		}		catch ( ChartException e )		{			if ( isSupportedByJavaxImageIO( ) )			{				throw e;			}			else			{				logger.log( ILogger.INFORMATION,						Messages.getString( "info.use.custom.image.writer", //$NON-NLS-1$								new Object[]{										getFormat( ), BmpWriter.class.getName( )								}, getLocale( ) ) );				// If not supported by JavaxImageIO, use our own.				BmpWriter bw = null;				if ( _oOutputIdentifier instanceof OutputStream )				{					bw = new BmpWriter( _img );					try					{						bw.write( (OutputStream) _oOutputIdentifier );					}					catch ( Exception ex )					{						throw new ChartException( ChartDeviceExtensionPlugin.ID,								ChartException.RENDERING,								ex );					}				}				else if ( _oOutputIdentifier instanceof String )				{					FileOutputStream fos = null;					try					{						fos = new FileOutputStream( (String) _oOutputIdentifier );						bw = new BmpWriter( _img );						bw.write( fos );						fos.close( );					}					catch ( Exception ex )					{						throw new ChartException( ChartDeviceExtensionPlugin.ID,								ChartException.RENDERING,								ex );					}				}				else				{					throw new ChartException( ChartDeviceExtensionPlugin.ID,							ChartException.RENDERING,							"exception.unable.write.output.identifier", //$NON-NLS-1$							new Object[]{								_oOutputIdentifier							},							ResourceBundle.getBundle( Messages.DEVICE_EXTENSION,									getLocale( ) ) );				}			}		}	}