How to save an image file

Is it possible to save to a BMP or a GIF file without having to go figure out the file structure and using FileOutputStream and the like to directly write the byte data? Like taking a BufferedImage and directly saving it to disk.

ImageIO.write

Kev