code: public static Charset[] getAvailableCharsets() {
          Collection collection = Charset.availableCharsets().values();
          return (Charset[]) collection.toArray(new Charset[collection.size()]);
      }
docs: Retrieves all the available <code>Charset</code>s on the platform,
  among which the default <code>charset</code>.
  
  @return an array of <code>Charset</code>s.