类 Base64Utils

java.lang.Object
icu.xuyijie.base64utils.Base64Utils

public class Base64Utils extends Object
作者:
徐一杰
  • 方法详细资料

    • transferToBase64

      public static String transferToBase64(String filePath) throws IOException
      将文件转换成 Base64 码
      参数:
      filePath - 文件全路径
      返回:
      base64码
      抛出:
      IOException
    • transferToBase64

      public static String transferToBase64(File file) throws IOException
      将文件转换成 Base64 码
      参数:
      file - 文件对象
      返回:
      base64码
      抛出:
      IOException
    • generateFile

      public static String generateFile(String base64Str, String folderPath, String fileName)
      进行Base64解码并生成文件保存到指定路径 imgFilePath 待保存的本地路径
      参数:
      base64Str - base64码
      folderPath - 要保存的文件位置(不含文件名)
      fileName - 文件名
      返回:
      保存的文件全路径(含文件名)
    • generateFile

      public static String generateFile(String base64Str, String filePath)
      进行Base64解码并生成文件保存到指定路径 imgFilePath 待保存的本地路径
      参数:
      base64Str - base64码
      filePath - 要保存的文件全路径(含文件名)
      返回:
      保存的文件全路径(含文件名)