类 IOUtil

java.lang.Object
tech.mhuang.pacebox.core.io.IOUtil

public class IOUtil extends Object
IO工具类.

提取各种比较好的工具类调用等

从以下版本开始:
1.0.0
作者:
mhuang
  • 字段详细资料

  • 构造器详细资料

    • IOUtil

      public IOUtil()
  • 方法详细资料

    • toString

      public static String toString(InputStream in) throws IOException
      InputStream convert String default close stream
      参数:
      in - inputstream
      返回:
      tring type data
      抛出:
      IOException - IOException
    • toString

      public static String toString(InputStream in, String encoding) throws IOException
      InputStream convert String used encoding default close stream
      参数:
      in - inputstream
      encoding - encoding
      返回:
      string type data
      抛出:
      IOException - IOException
    • toString

      public static String toString(InputStream in, boolean isClosed) throws IOException
      InputStream convert String setter isClosed stream used defaulte ncoding
      参数:
      in - InputStream
      isClosed - if true closed input stream or false not closed
      返回:
      String
      抛出:
      IOException - IOException
    • toString

      public static String toString(InputStream in, String encoding, boolean isClosed) throws IOException
      inputsteam convert to string used encoding configuration closed stream
      参数:
      in - inpustream
      encoding - encoding
      isClosed - if true closed input stream or false not closed
      返回:
      string type data
      抛出:
      IOException - IOException
    • toByteArray

      public static byte[] toByteArray(InputStream input) throws IOException
      InputStream convert byte[] default close stream
      参数:
      input - inputstream
      返回:
      bytearray type data
      抛出:
      IOException - IOException
    • toOutputStream

      public static OutputStream toOutputStream(InputStream input) throws IOException
      InputStream convert OutputStream default close stream
      参数:
      input - inputstream
      返回:
      OutputStream
      抛出:
      IOException - IOException
    • toOutputStream

      public static OutputStream toOutputStream(InputStream input, boolean isClosed) throws IOException
      InputStream convert OutputStream configuration cloed stream
      参数:
      input - inpustream
      isClosed - if true closed input stream or false not closed
      返回:
      OutputStream
      抛出:
      IOException - IOException
    • toByteArray

      public static byte[] toByteArray(InputStream input, boolean isClosed) throws IOException
      InputStream convert byte[] configuration cloed stream
      参数:
      input - inpustream
      isClosed - if true closed input stream or false not closed
      返回:
      byte[]
      抛出:
      IOException - IOException
    • copy

      public static void copy(InputStream input, OutputStream output, boolean isClosed) throws IOException
      copy input to out
      参数:
      input - input
      output - output
      isClosed - isClosed
      抛出:
      IOException - io
      从以下版本开始:
      1.0.17
    • copy

      public static int copy(InputStream input, OutputStream output) throws IOException
      copy inputstream to outputstream default set buffer size 4MB
      参数:
      input - inputstream
      output - outputstream
      返回:
      size
      抛出:
      IOException - IOException
    • copyLarge

      public static long copyLarge(InputStream input, OutputStream output) throws IOException
      copy inputstream to outputstream default set buffer size 4M
      参数:
      input - inputstream
      output - outputstream
      返回:
      size
      抛出:
      IOException - IOException
    • copy

      public static long copy(InputStream input, OutputStream output, int bufferSize) throws IOException
      copy inputstream to outputstream set buffer size
      参数:
      input - inputstream
      output - outputstream
      bufferSize - buffer size
      返回:
      size
      抛出:
      IOException - IOException
    • copyLarge

      public static long copyLarge(InputStream input, OutputStream output, byte[] buffer) throws IOException
      copy inputstream to outputstream set buffer size
      参数:
      input - inputstream
      output - outputstream
      buffer - buffer size
      返回:
      size
      抛出:
      IOException - IOException
    • close

      public static void close(URLConnection conn)
      closed URLConnection
      参数:
      conn - URLConnection
    • close

      public static void close(Reader input)
      closed Reader
      参数:
      input - Reader
    • close

      public static void close(Writer output)
      closed Writer
      参数:
      output - Writer
    • close

      public static void close(InputStream input)
      closed InputStream
      参数:
      input - InputStream
    • close

      public static void close(OutputStream output)
      closed OutputStream
      参数:
      output - OutputStream
    • close

      public static void close(Closeable closeable)
      closed Closeable
      参数:
      closeable - Closeable
    • close

      public static void close(Closeable... closeables)
      closed Closeable...
      参数:
      closeables - Closeable...
    • write

      public static void write(String data, OutputStream output, Charset encoding) throws IOException
      outputstream write data
      参数:
      data - data type string
      output - outputstream
      encoding - encoding
      抛出:
      IOException - IOException
    • write

      public static void write(String data, OutputStream output) throws IOException
      outputstream write data
      参数:
      data - data type string
      output - outputstream
      抛出:
      IOException - IOException
    • write

      public static void write(byte[] data, OutputStream output) throws IOException
      outputstream write data
      参数:
      data - data type byte[]
      output - outputstream
      抛出:
      IOException - IOException