1. requiredCharsets:由Java平台支持字符集对象标准名称,构造一个sorted map。

    public void test() {
    Map<String, Charset> sortedMap = Charsets.requiredCharsets();
    Set<Map.Entry<String, Charset>> entrySet = sortedMap.entrySet();
    for (Map.Entry<String, Charset> entry : entrySet) {
    System.out.println(entry.getKey());
    }
    }
  2. toCharset(Charset):获取Charset,参数为空,获取平台默认编码格式。
    public void test2() {
    Charset defaultCharset = null;
    Charset charset = Charsets.toCharset(defaultCharset); //获取平台默认编码格式
    System.out.println(charset.displayName());
    }
  3. toCharset(String):输入字符串编码格式名称获取对应Charset,参数为空,获取平台默认编码格式。
    public void test3() {
    Charset defaultCharset = null;
    Charset charset = Charsets.toCharset(defaultCharset); // 获取平台默认编码格式
    System.out.println(charset.displayName()); charset = Charsets.toCharset(Charsets.UTF_8);
    System.out.println(charset.displayName());
    }

org.apache.commons.io.Charsets的更多相关文章

  1. 报错:maven:java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets

    运行报错: maven:java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets 找不到Charsets这个类 上网查了以后,是因为 ...

  2. 使用Apache Commons IO组件读取大文件

    Apache Commons IO读取文件代码如下: Files.readLines(new File(path), Charsets.UTF_8); FileUtils.readLines(new ...

  3. apache.commons.io.IOUtils: 一个很方便的IO工具库(比如InputStream转String)

    转换InputStream到String, 比如 //引入apache的io包 import org.apache.commons.io.IOUtils; ... ...String str = IO ...

  4. Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils

    1.错误叙述性说明 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/web ...

  5. apache commons io包基本功能

    1. http://jackyrong.iteye.com/blog/2153812 2. http://www.javacodegeeks.com/2014/10/apache-commons-io ...

  6. java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream(转)

    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream 使用Tomcat的Manag ...

  7. IO与文件读写---使用Apache commons IO包提高读写效率

    觉得很不错,就转载了, 作者: Paul Lin 首先贴一段Apache commons IO官网上的介绍,来对这个著名的开源包有一个基本的了解:Commons IO is a library of ...

  8. Apache Commons IO入门教程(转)

    Apache Commons IO是Apache基金会创建并维护的Java函数库.它提供了许多类使得开发者的常见任务变得简单,同时减少重复(boiler-plate)代码,这些代码可能遍布于每个独立的 ...

  9. [转]Apache Commons IO入门教程

    Apache Commons IO是Apache基金会创建并维护的Java函数库.它提供了许多类使得开发者的常见任务变得简单,同时减少重复(boiler-plate)代码,这些代码可能遍布于每个独立的 ...

随机推荐

  1. uoj206 [APIO2016]最大差分

    ref #include "gap.h" #include <iostream> #include <cstdio> using namespace std ...

  2. Tensorflow实现Mask R-CNN实例分割通用框架,检测,分割和特征点定位一次搞定(多图)

    Mask R-CNN实例分割通用框架,检测,分割和特征点定位一次搞定(多图)   导语:Mask R-CNN是Faster R-CNN的扩展形式,能够有效地检测图像中的目标,同时还能为每个实例生成一个 ...

  3. 【Reverse Integer】cpp

    题目: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click ...

  4. 静态文本框控件的美化CStatic

    VC通用控件都是灰色,当对程序界面进行美化时,使用通用控件就和美化后的程序界面不搭配,在VB,C#中,可以很方便的更改控件背景颜色,但在VC中就不能,需要我们自己来完善这方面的功能.我在这只简单的介绍 ...

  5. Python基础-week08 并发编程

    一 背景知识 顾名思义,进程即正在执行的一个过程.进程是对正在运行程序的一个抽象. 进程的概念起源于操作系统,是操作系统最核心的概念,也是操作系统提供的最古老也是最重要的抽象概念之一.操作系统的其他所 ...

  6. [Cocos2dx Bug] [win32] Function CCFileUtils::fullPathFromRelativeFile forget consider the path separated by '\\'

    [Cocos2dx 2.2.4] [win32平台Bug] const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilen ...

  7. 【bzoj3544】[ONTAK2010]Creative Accounting 前缀和+STL-set

    题目描述 给定一个长度为N的数组a和M,求一个区间[l,r],使得$(\sum\limits_{i=l}^{r}{a_i})\ mod\ M$的值最大,求出这个值,注意这里的mod是数学上的mod(即 ...

  8. 【VBA】Do While……Loop循环,遍历某列

    [说明] Do While……Loop循环,遍历某列 i = Do While Trim(T_sh.Cells(i, NOTESID_COL)) <> "" If T_ ...

  9. layer相关

    关闭窗口 var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);

  10. Mybatis Plugin插件安装破解及使用

    2018年2月更新 2018年2月份,提供一个网上比较多的一个版本V3.21版本,下载资源里面有个已整合版直接解压放入C:\Users\你的用户名\.IntelliJIdea2017.3\config ...