类 IoUtils

java.lang.Object
cn.ezeyc.edpenc.util.IoUtils

public class IoUtils extends Object
作者:
wz
  • 构造器详细资料

    • IoUtils

      public IoUtils()
  • 方法详细资料

    • writeFile

      public static void writeFile(File file, byte[] fileBytes)
      写文件
      参数:
      file - 文件
      fileBytes - 字节
    • readFileToByte

      public static byte[] readFileToByte(File file)
      读取文件
      参数:
      file - 文件
      返回:
      字节
    • toBytes

      public static byte[] toBytes(InputStream input) throws IOException
      stream2byte[]
      参数:
      input - 输入流
      返回:
      字节
      抛出:
      IOException - IOException
    • listFile

      public static void listFile(List<File> fileList, File dir, String endWith)
      递归查找文件,只返回文件
      参数:
      fileList - 返回的文件列表
      dir - 目录
      endWith - 文件后缀
    • listFile

      public static void listFile(List<File> filess, File dir)
      枚举所有文件,包括文件夹
      参数:
      filess - 返回的文件列表
      dir - 目录
    • delete

      public static void delete(File dir)
      删除整个目录
      参数:
      dir - 目录
    • crc32

      public static long crc32(byte[] bytes)
      计算cec
      参数:
      bytes - 字节
      返回:
      crc值
    • close

      public static void close(Closeable... outs)
      关闭流
      参数:
      outs - Closeable
    • readTxtFile

      public static String readTxtFile(File file)
      读取文本文件
      参数:
      file - 文件
      返回:
      内容
    • writeTxtFile

      public static void writeTxtFile(File file, String txt)
      写文件
      参数:
      file - 文件
      txt - 内容
    • merger

      public static byte[] merger(byte[]... bts)
      合并byte[]
      参数:
      bts - 字节数组
      返回:
      合并后的字节