public class IOUtils extends Object
构造器和说明 |
---|
IOUtils() |
限定符和类型 | 方法和说明 |
---|---|
static int |
clone(InputStream in,
long len,
OutputStream out) |
static int |
clone(InputStream in,
OutputStream out) |
static int |
clone(Reader in,
Writer out)
Copy the contents of the given Reader to the given Writer.
|
static int |
cloneWithoutClose(InputStream in,
long len,
OutputStream out) |
static void |
close(Closeable... clos) |
static void |
closeIO(InputStream in)
静默关闭输入流
|
static void |
closeIO(InputStream in,
OutputStream out) |
static void |
closeIO(OutputStream out)
静默关闭输出流
|
static void |
closeIO(Reader in) |
static void |
closeIO(Reader in,
Writer out) |
static void |
closeIO(Writer out) |
static String |
copyToString(Reader in)
Copy the contents of the given Reader into a String.
|
static BufferedReader |
getBufferedReader(String fileFullPath,
String charSet)
get BufferedReader input stream
|
static BufferedWriter |
getBufferedWriter(String fileFullPath,
boolean append,
String charSet)
get BufferedWriter output stream
|
static InputStream |
getInputStreamFromString(String str,
String charSet)
将字符串转换为 InputStream 输入流
|
static Reader |
getReaderFromString(String str)
将字符串转换为 Reader 输入流
|
public static BufferedWriter getBufferedWriter(String fileFullPath, boolean append, String charSet) throws IOException
fileFullPath
- the absolute file pathappend
- true if can appendcharSet
- assign charSet,null if use the default charSetIOException
public static final BufferedReader getBufferedReader(String fileFullPath, String charSet) throws IOException
fileFullPath
- the absolute file pathcharSet
- assign charSet,null if use the default charSetIOException
public static final InputStream getInputStreamFromString(String str, String charSet)
charSet
- 指定字符编码public static String copyToString(Reader in) throws IOException
in
- the reader to copy fromIOException
- in case of I/O errorspublic static final int clone(InputStream in, OutputStream out) throws IOException
public static int clone(Reader in, Writer out) throws IOException
in
- the Reader to copy fromout
- the Writer to copy toIOException
- in case of I/O errorspublic static final int clone(InputStream in, long len, OutputStream out) throws IOException
len
- in-source-length e.g. long len = fileIn.length()IOException
public static final int cloneWithoutClose(InputStream in, long len, OutputStream out) throws IOException
len
- in-source-length e.g. long len = fileIn.length()IOException
public static final void closeIO(OutputStream out)
public static final void closeIO(Writer out)
public static final void closeIO(InputStream in)
public static final void closeIO(Reader in)
public static final void close(Closeable... clos)
public static final void closeIO(InputStream in, OutputStream out)
Copyright © 2018 jretty-org. All rights reserved.