类 IOUtil

java.lang.Object
com.weicoder.common.io.IOUtil
直接已知子类:
U.I

public class IOUtil extends Object
IO流操作
作者:
WD
  • 构造器详细资料

    • IOUtil

      public IOUtil()
  • 方法详细资料

    • write

      public static long write(OutputStream out, InputStream in, int buff, boolean isClose, Callback<Buffer,Buffer> call)
      读取并写入数据
      参数:
      rbc - 读取通道
      wbc - 写入通道
      buff - 每次读取缓存数
      isClose - 是否关闭流
      call - 回调
      返回:
      读取流总数
    • readString

      public static String readString(InputStream in)
      读取InputStream内容成为字符串 默认使用UTF-8
      参数:
      in - 输入流
      返回:
      读取的字符串
    • readString

      public static String readString(InputStream in, String charsetName)
      读取InputStream内容成为字符串
      参数:
      in - 输入流
      charsetName - 编码格式
      返回:
      读取的字符串
    • readString

      public static String readString(InputStream in, String charsetName, boolean isClose)
      读取InputStream内容成为字符串
      参数:
      in - 输入流
      charsetName - 编码格式
      isClose - 是否关闭流
      返回:
      读取的字符串
    • read

      public static byte[] read(InputStream in)
      读取出输入流的所有字节
      参数:
      in - 输入流
      返回:
      字节数组
    • read

      public static long read(InputStream in, int buff, boolean isClose, CallbackVoid<Buffer> call)
      读取出输入流的所有字节
      参数:
      in - 输入流
      isClose - 是否关闭流
      返回:
      字节数组
    • read

      public static byte[] read(InputStream in, boolean isClose)
      读取出输入流的所有字节
      参数:
      in - 输入流
      isClose - 是否关闭流
      返回:
      字节数组
    • write

      public static boolean write(OutputStream out, String text)
      把text写入到os中 默认使用UTF-8编码
      参数:
      out - 输出流
      text - 输入的字符串
      返回:
      boolean
    • write

      public static boolean write(OutputStream out, String text, String charsetName)
      把text写入到os中
      参数:
      out - 输出流
      text - 输入的字符串
      charsetName - 编码格式
      返回:
      true false
    • write

      public static boolean write(OutputStream out, String text, String charsetName, boolean isClose)
      把text写入到os中
      参数:
      out - 输出流
      text - 输入的字符串
      charsetName - 编码格式
      isClose - 是否关闭流
      返回:
      true false
    • write

      public static boolean write(OutputStream out, byte[] b)
      把字节数组写入到流中
      参数:
      out - 输出流
      b - 字节数组
      返回:
      是否成功
    • write

      public static boolean write(OutputStream out, byte[] b, boolean isClose)
      把字节数组写入到流中
      参数:
      out - 输出流
      b - 字节数组
      isClose - 是否关闭流
      返回:
      是否成功
    • write

      public static boolean write(OutputStream out, InputStream in)
      把text写入到out中
      参数:
      out - 输出流
      in - 输入流
      返回:
      true false
    • write

      public static boolean write(OutputStream out, InputStream in, boolean isClose)
      把text写入到out中
      参数:
      out - 输出流
      in - 输入流
      isClose - 是否关闭流
      返回:
      true false