net.lingala.zip4j.util.Zip4jUtil.isSupportedCharset()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中net.lingala.zip4j.util.Zip4jUtil.isSupportedCharset()方法的一些代码示例,展示了Zip4jUtil.isSupportedCharset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zip4jUtil.isSupportedCharset()方法的具体详情如下:
包路径:net.lingala.zip4j.util.Zip4jUtil
类名称:Zip4jUtil
方法名:isSupportedCharset

Zip4jUtil.isSupportedCharset介绍

[英]Checks if the input charset is supported
[中]检查是否支持输入字符集

代码示例

代码示例来源:origin: com.github.axet/zip4j

/**
 * Zip4j will encode all the file names with the input charset. This method throws
 * an exception if the Charset is not supported
 * @param charsetName
 * @throws ZipException
 */
public void setFileNameCharset(String charsetName) throws ZipException {
  if (!Zip4jUtil.isStringNotNullAndNotEmpty(charsetName)) {
    throw new ZipException("null or empty charset name");
  }
  
  if (!Zip4jUtil.isSupportedCharset(charsetName)) {
    throw new ZipException("unsupported charset: " + charsetName);
  }
  
  this.fileNameCharset = charsetName;
}

代码示例来源:origin: net.lingala.zip4j/zip4j

/**
 * Zip4j will encode all the file names with the input charset. This method throws
 * an exception if the Charset is not supported
 * @param charsetName
 * @throws ZipException
 */
public void setFileNameCharset(String charsetName) throws ZipException {
  if (!Zip4jUtil.isStringNotNullAndNotEmpty(charsetName)) {
    throw new ZipException("null or empty charset name");
  }
  
  if (!Zip4jUtil.isSupportedCharset(charsetName)) {
    throw new ZipException("unsupported charset: " + charsetName);
  }
  
  this.fileNameCharset = charsetName;
}

代码示例来源:origin: net.lingala.zip4j/zip4j

int commentLength = comment.length();
if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) {
  try {
    encodedComment = new String(comment.getBytes(InternalZipConstants.CHARSET_COMMENTS_DEFAULT), InternalZipConstants.CHARSET_COMMENTS_DEFAULT);

代码示例来源:origin: com.github.axet/zip4j

int commentLength = comment.length();
if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) {
  try {
    encodedComment = new String(comment.getBytes(InternalZipConstants.CHARSET_COMMENTS_DEFAULT), InternalZipConstants.CHARSET_COMMENTS_DEFAULT);

代码示例来源:origin: net.lingala.zip4j/zip4j

if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) {
  encoding = InternalZipConstants.CHARSET_COMMENTS_DEFAULT;
} else {

代码示例来源:origin: com.github.axet/zip4j

if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) {
  encoding = InternalZipConstants.CHARSET_COMMENTS_DEFAULT;
} else {

相关文章