public class InputStreamUtils extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 构造器和说明 |
|---|
InputStreamUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static InputStream |
byteTOInputStream(byte[] in)
将byte数组转换成InputStream
|
static String |
byteTOString(byte[] in)
将byte数组转换成String
|
static byte[] |
InputStreamTOByte(InputStream in)
将InputStream转换成byte数组
|
static String |
InputStreamTOString(InputStream in)
将InputStream转换成String
|
static String |
InputStreamTOString(InputStream in,
String encoding)
将InputStream转换成某种字符编码的String
|
static byte[] |
StringTOByte(String in)
将String转换成InputStream
|
static InputStream |
StringTOInputStream(String in)
将String转换成InputStream
|
public static String InputStreamTOString(InputStream in) throws Exception
in - InputStreamExceptionpublic static String InputStreamTOString(InputStream in, String encoding) throws Exception
in - encoding - Exceptionpublic static InputStream StringTOInputStream(String in) throws Exception
in - Exceptionpublic static byte[] StringTOByte(String in) throws Exception
in - Exceptionpublic static byte[] InputStreamTOByte(InputStream in) throws IOException
in - InputStreamIOExceptionpublic static InputStream byteTOInputStream(byte[] in) throws Exception
in - ExceptionCopyright © 2020. All rights reserved.