public class IOUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
bytesToObject(byte[] objBytes) |
static void |
close(Closeable... closeables) |
static void |
closeQuietly(Closeable... closeables) |
static ByteBuffer |
getByteBuffer(Object obj) |
static byte[] |
getBytes(InputStream is) |
static byte[] |
objectToBytes(Object obj) |
static Object |
streamToObject(InputStream is) |
static InputStream |
strToInputStream(String str,
String charset) |
public static InputStream strToInputStream(String str, String charset) throws Exception
str - charset - Exceptionpublic static byte[] objectToBytes(Object obj)
obj - public static Object bytesToObject(byte[] objBytes)
objBytes - public static Object streamToObject(InputStream is)
is - public static byte[] getBytes(InputStream is) throws Exception
is - Exceptionpublic static ByteBuffer getByteBuffer(Object obj) throws IOException
IOExceptionpublic static void close(Closeable... closeables) throws IOException
closeables - 可关闭的流对象列表IOExceptionpublic static void closeQuietly(Closeable... closeables)
closeables - 可关闭的流对象列表Copyright © 2023. All rights reserved.