|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.baidu.driver4j.bns.IOUtils
public class IOUtils
IN/OUT utility class
| 构造方法摘要 | |
|---|---|
IOUtils()
|
|
| 方法摘要 | |
|---|---|
static int |
copy(InputStream input,
OutputStream output)
Copy bytes from an InputStream to an
OutputStream. |
static void |
copy(InputStream input,
Writer output)
Copy bytes from an InputStream to chars on a
Writer using the default character encoding of the platform. |
static int |
copy(Reader input,
Writer output)
Copy chars from a Reader to a Writer. |
static long |
copyLarge(InputStream input,
OutputStream output)
Copy bytes from a large (over 2GB) InputStream to an
OutputStream. |
static long |
copyLarge(Reader input,
Writer output)
Copy chars from a large (over 2GB) Reader to a Writer. |
static byte[] |
toByteArray(InputStream input)
Get the contents of an InputStream as a byte[]. |
static String |
toString(InputStream input)
Get the contents of an InputStream as a String
using the default character encoding of the platform. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public IOUtils()
| 方法详细信息 |
|---|
public static byte[] toByteArray(InputStream input)
throws IOException
InputStream as a byte[].
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
input - the InputStream to read from
NullPointerException - if the input is null
IOException - if an I/O error occurs
public static int copy(InputStream input,
OutputStream output)
throws IOException
InputStream to an
OutputStream.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
Large streams (over 2GB) will return a bytes copied value of
-1 after the copy has completed since the correct
number of bytes cannot be returned as an int. For large streams
use the copyLarge(InputStream, OutputStream) method.
input - the InputStream to read fromoutput - the OutputStream to write to
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
ArithmeticException - if the byte count is too large
public static long copyLarge(InputStream input,
OutputStream output)
throws IOException
InputStream to an
OutputStream.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
input - the InputStream to read fromoutput - the OutputStream to write to
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
public static String toString(InputStream input)
throws IOException
InputStream as a String
using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
input - the InputStream to read from
NullPointerException - if the input is null
IOException - if an I/O error occurs
public static void copy(InputStream input,
Writer output)
throws IOException
InputStream to chars on a
Writer using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
This method uses InputStreamReader.
input - the InputStream to read fromoutput - the Writer to write to
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
public static int copy(Reader input,
Writer output)
throws IOException
Reader to a Writer.
This method buffers the input internally, so there is no need to use a
BufferedReader.
Large streams (over 2GB) will return a chars copied value of
-1 after the copy has completed since the correct
number of chars cannot be returned as an int. For large streams
use the copyLarge(Reader, Writer) method.
input - the Reader to read fromoutput - the Writer to write to
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
ArithmeticException - if the character count is too large
public static long copyLarge(Reader input,
Writer output)
throws IOException
Reader to a Writer.
This method buffers the input internally, so there is no need to use a
BufferedReader.
input - the Reader to read fromoutput - the Writer to write to
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||