Java IO Tutorial - Java Charset.isSupported(String charsetName)








Syntax

Charset.isSupported(String charsetName) has the following syntax.

public static boolean isSupported(String charsetName)

Example

In the following code shows how to use Charset.isSupported(String charsetName) method.

import java.nio.charset.Charset;
/*from w  ww . j ava2 s.  c  o  m*/
public class Main {


  public static void main(String[] args) {
    boolean b = Charset.isSupported("UTF-16LE");

    System.out.println(b);
  }
}

The code above generates the following result.