tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Java > Image IO > How to get supported suffixes

How to get supported suffixes 

Java Image IO provides pluggable architecture for accessing images transparently. It is simple, flexible and allows us to plugin various image readers and writers with ease. The following example shows getting supported image file suffixes, format names and mime types.

File Name  :  
Author  :  Sudhakar KV
Email  :  [email protected]
package com.bethecoder.tutorials.imageio;

import java.util.Arrays;
import javax.imageio.ImageIO;

public class SupportedSuffixesTest {

   @param args
  public static void main(String[] args) {

    //file suffixes associated with the formats understood
      //by the current set of registered readers.
    //file suffixes associated with the formats understood
    //by the current set of registered writers.
    //Format names understood by the current set of registered readers.
    //Format names understood by the current set of registered writers.
    //MIME types understood by the current set of registered readers.
    //MIME types understood by the current set of registered writers.


It gives the following output,
[bmp, jpg, jpeg, wbmp, png, gif]
[bmp, jpg, wbmp, jpeg, png, gif]
[BMP, bmp, jpg, JPG, jpeg, wbmp, png, JPEG, PNG, WBMP, GIF, gif]
[BMP, bmp, jpg, JPG, wbmp, jpeg, png, PNG, JPEG, WBMP, GIF, gif]
[image/jpeg, image/png, image/x-png, image/vnd.wap.wbmp, image/bmp, image/gif]
[image/png, image/jpeg, image/x-png, image/vnd.wap.wbmp, image/gif, image/bmp]


bl  br