Java获得文件编码格式计算机等级考试
文章作者 100test 发表时间 2010:01:01 12:29:49
来源 100Test.Com百考试题网
    
  Java代码
  import info.monitorenter.cpdetector.io.CodepageDetectorProxy.
  import info.monitorenter.cpdetector.io.JChardetFacade.
  import java.io.File.
  import java.nio.charset.Charset.
  public class CharacterEnding {
  public static String getFileCharacterEnding(String filePath) {
  File file = new File(filePath).
  return getFileCharacterEnding(file).
  }
  /**
  * Try to get file character ending.