public class InputOutputs extends Object
| 构造器和说明 |
|---|
InputOutputs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static BufferedReader |
buffered(Reader reader)
Wrap reader to buffered reader. if reader is buffered, return its self.
|
static void |
closeQuietly(AutoCloseable closeable)
Close quietly, do not throw exceptions
|
static void |
copy(InputStream input,
OutputStream output)
Copy input stream to output stream, and close input
|
static void |
copy(Reader reader,
Writer writer)
Copy reader to writer, and close reader
|
static byte[] |
readAll(InputStream input)
Read input to bytes, and then close input
|
static byte[] |
readAll(InputStream input,
int initialSize)
Read input to bytes, and then close input.
|
static String |
readAll(Reader reader)
Read reader to String, and then close reader
|
static int |
readExact(InputStream input,
byte[] data,
int offset,
int len)
Read exactly data with size.
|
static List<String> |
readLines(Reader reader)
Read reader to lines, and then close reader
|
static long |
skipAll(InputStream input)
Skip all input data, and finally close it
|
static long |
skipAll(Reader reader)
Skip all reader data, and finally close it
|
public static void copy(InputStream input, OutputStream output) throws IOException
IOExceptionpublic static byte[] readAll(InputStream input, int initialSize) throws IOException
initialSize - the initial size to be usedIOExceptionpublic static byte[] readAll(InputStream input) throws IOException
IOExceptionpublic static int readExact(InputStream input, byte[] data, int offset, int len) throws IOException
IOExceptionpublic static long skipAll(InputStream input) throws IOException
IOExceptionpublic static void closeQuietly(@Nullable AutoCloseable closeable)
public static void copy(Reader reader, Writer writer) throws IOException
IOExceptionpublic static String readAll(Reader reader) throws IOException
IOExceptionpublic static List<String> readLines(Reader reader) throws IOException
IOExceptionpublic static BufferedReader buffered(Reader reader)
public static long skipAll(Reader reader) throws IOException
IOExceptionCopyright © 2017. All rights reserved.