Java Charset Create getCharsetForSortOrder(final int sortOrder)

Here you can find the source of getCharsetForSortOrder(final int sortOrder)

Description

Retrieves the CharsetInfo instance asociated with the specified sort order.

License

Open Source License

Parameter

Parameter Description
sortOrder the server sort order

Return

the associated CharsetInfo

Declaration

private static Charset getCharsetForSortOrder(final int sortOrder) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

import java.nio.charset.*;

public class Main {
    /** Table of sort code to charset mappings.*/
    private static final String[] sortMap = new String[256];

    /**/*from w  ww. j  a v  a2 s .c  om*/
     * Retrieves the <code>CharsetInfo</code> instance asociated with the
     * specified sort order.
     *
     * @param sortOrder the server sort order
     * @return the associated <code>CharsetInfo</code>
     */
    private static Charset getCharsetForSortOrder(final int sortOrder) {
        String name = sortMap[sortOrder];
        return Charset.forName(name);
    }
}

Related

  1. getCharset(String contentType)
  2. getCharset(String enc)
  3. getCharset(String encoding)
  4. getCharset(String encoding)
  5. getCharset(String name)
  6. getCharsetFromContent(URL url)
  7. getCharsetFromContentType(String contentType)
  8. getCharsetFromContentType(String contentType)
  9. getCharsetFromContentTypeString(String contentType)