|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.xiaoleilu.hutool.IoUtil
public class IoUtil
IO工具类
| 字段摘要 | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
默认缓存大小 |
| 构造方法摘要 | |
|---|---|
IoUtil()
|
|
| 方法摘要 | |
|---|---|
static long |
copy(FileInputStream in,
FileOutputStream out)
拷贝文件流,使用NIO |
static int |
copy(InputStream in,
OutputStream out)
拷贝流,使用默认Buffer大小 |
static int |
copy(InputStream in,
OutputStream out,
int bufferSize)
拷贝流 |
static int |
copy(Reader reader,
Writer writer)
将Reader中的内容复制到Writer中 使用默认缓存大小 |
static int |
copy(Reader reader,
Writer writer,
int bufferSize)
将Reader中的内容复制到Writer中 |
static void |
echo(Object content,
Object... param)
打印内容,调用系统的System.out.println方法 |
static String |
getString(InputStream in,
String charset)
从流中读取内容 |
static ByteArrayInputStream |
toStream(String content,
String charset)
String 转为 流 |
static void |
write(OutputStream out,
String charset,
boolean isCloseOut,
Object... contents)
将多部分内容写到流中,自动转换为字符串 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int DEFAULT_BUFFER_SIZE
| 构造方法详细信息 |
|---|
public IoUtil()
| 方法详细信息 |
|---|
public static int copy(Reader reader,
Writer writer)
throws IOException
reader - Readerwriter - Writer
IOException
public static int copy(Reader reader,
Writer writer,
int bufferSize)
throws IOException
IOException
public static int copy(InputStream in,
OutputStream out)
throws IOException
in - 输入流out - 输出流
IOException
public static int copy(InputStream in,
OutputStream out,
int bufferSize)
throws IOException
in - 输入流out - 输出流bufferSize - 缓存大小
IOException
public static long copy(FileInputStream in,
FileOutputStream out)
throws IOException
in - 输入out - 输出
IOException
public static String getString(InputStream in,
String charset)
throws IOException
in - 输入流charset - 字符集
IOException
public static ByteArrayInputStream toStream(String content,
String charset)
content - 内容charset - 编码
public static void write(OutputStream out,
String charset,
boolean isCloseOut,
Object... contents)
throws IOException
out - 输出流charset - 写出的内容的字符集isCloseOut - 写入完毕是否关闭输出流contents - 写入的内容,调用toString()方法,不包括不会自动换行
IOException
public static void echo(Object content,
Object... param)
content - 内容,会调用toString方法, 当内容中有 {} 表示变量占位符param - 参数
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||