public abstract class IOUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_BYTE_BUFFER_SIZE |
static int |
DEFAULT_CHAR_BUFFER_SIZE |
static int |
EOF |
static String |
NEWLINE |
| 构造器和说明 |
|---|
IOUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
checkRange(int start,
int limit) |
static void |
close(Closeable closeable) |
static void |
closeQuietly(Closeable closeable) |
static void |
copy(byte[] input,
Writer writer,
Charset charset) |
static void |
copy(byte[] input,
Writer writer,
Charset charset,
int maxSize) |
static void |
copy(byte[] input,
Writer writer,
Charset charset,
int bufferSize,
int maxSize) |
static void |
copy(byte[] input,
Writer writer,
String charset) |
static void |
copy(char[] input,
OutputStream output,
Charset charset) |
static void |
copy(char[] input,
OutputStream output,
String charset) |
static void |
copy(CharSequence input,
OutputStream output,
Charset charset) |
static void |
copy(CharSequence input,
OutputStream output,
String charset) |
static long |
copy(InputStream input,
OutputStream output) |
static long |
copy(InputStream input,
OutputStream output,
int maxSize) |
static long |
copy(InputStream input,
OutputStream output,
int bufferSize,
int maxSize) |
static void |
copy(InputStream input,
Writer writer,
Charset charset) |
static void |
copy(InputStream input,
Writer writer,
Charset charset,
int maxSize) |
static void |
copy(InputStream input,
Writer writer,
Charset charset,
int bufferSize,
int maxSize) |
static void |
copy(InputStream input,
Writer writer,
String charset) |
static void |
copy(Reader reader,
OutputStream output,
Charset charset) |
static void |
copy(Reader reader,
OutputStream output,
Charset charset,
int maxSize) |
static void |
copy(Reader reader,
OutputStream output,
Charset charset,
int bufferSize,
int maxSize) |
static void |
copy(Reader reader,
OutputStream output,
String charset) |
static long |
copy(Reader reader,
Writer writer) |
static long |
copy(Reader reader,
Writer writer,
int maxSize) |
static long |
copy(Reader reader,
Writer writer,
int bufferSize,
int maxSize) |
static void |
copyLines(byte[] bytes,
Charset charset,
List<String> results) |
static void |
copyLines(byte[] bytes,
String charset,
List<String> results) |
static void |
copyLines(char[] array,
List<String> results) |
static void |
copyLines(InputStream in,
Charset charset,
List<String> results) |
static int |
copyLines(InputStream in,
Charset charset,
StringBuffer str) |
static int |
copyLines(InputStream in,
Charset charset,
StringBuilder str) |
static void |
copyLines(InputStream in,
String charset,
List<String> results) |
static int |
copyLines(InputStream in,
String charset,
StringBuffer str) |
static int |
copyLines(InputStream in,
String charset,
StringBuilder str) |
static void |
copyLines(Reader reader,
List<String> results) |
static int |
copyLines(Reader reader,
StringBuffer str) |
static int |
copyLines(Reader reader,
StringBuilder str) |
static void |
copyLines(Reader reader,
Writer writer) |
static ByteBuffer |
emptyByteBuffer() |
static void |
flush(OutputStream out) |
static void |
flush(Writer writer) |
static void |
flushAndClose(OutputStream os) |
static void |
flushAndClose(Writer writer) |
static void |
flushAndCloseQuietly(OutputStream os) |
static void |
flushAndCloseQuietly(Writer writer) |
static void |
flushQuietly(OutputStream out) |
static void |
flushQuietly(Writer writer) |
static BufferedInputStream |
getBufferedInputStream(InputStream in) |
static BufferedInputStream |
getBufferedInputStream(InputStream in,
int size) |
static BufferedOutputStream |
getBufferedOutputStream(OutputStream out) |
static BufferedOutputStream |
getBufferedOutputStream(OutputStream out,
int size) |
static BufferedReader |
getBufferedReader(InputStream in,
Charset charset) |
static BufferedReader |
getBufferedReader(InputStream in,
Charset charset,
int size) |
static BufferedReader |
getBufferedReader(InputStream in,
String charset) |
static BufferedReader |
getBufferedReader(InputStream in,
String charset,
int size) |
static BufferedReader |
getBufferedReader(Reader reader) |
static BufferedReader |
getBufferedReader(Reader reader,
int size) |
static BufferedWriter |
getBufferedWriter(OutputStream os,
Charset charset) |
static BufferedWriter |
getBufferedWriter(OutputStream os,
Charset charset,
int size) |
static BufferedWriter |
getBufferedWriter(OutputStream os,
String charset) |
static BufferedWriter |
getBufferedWriter(OutputStream os,
String charset,
int size) |
static BufferedWriter |
getBufferedWriter(Writer writer) |
static BufferedWriter |
getBufferedWriter(Writer writer,
int size) |
private static byte[] |
getByteBuffer(int bufferSize) |
private static char[] |
getCharBuffer(int bufferSize) |
static DataInputStream |
getDataInputStream(InputStream in) |
static DataOutputStream |
getDataOutputStream(OutputStream out) |
static GZIPInputStream |
getGZIPInputStream(InputStream in) |
static GZIPInputStream |
getGZIPInputStream(InputStream in,
int size) |
static GZIPOutputStream |
getGZIPOutputStream(OutputStream out) |
static GZIPOutputStream |
getGZIPOutputStream(OutputStream out,
int size) |
static LineNumberReader |
getLineNumberReader(InputStream in,
Charset charset) |
static LineNumberReader |
getLineNumberReader(InputStream in,
Charset charset,
int size) |
static LineNumberReader |
getLineNumberReader(InputStream in,
String charset) |
static LineNumberReader |
getLineNumberReader(InputStream in,
String charset,
int size) |
static LineNumberReader |
getLineNumberReader(Reader reader) |
static LineNumberReader |
getLineNumberReader(Reader reader,
int size) |
static ObjectInputStream |
getObjectInputStream(InputStream in) |
static ObjectOutputStream |
getObjectOutputStream(OutputStream out) |
(专用程序包) static boolean |
isValidLine(int start,
int limit,
int lineNumber) |
static void |
rangeCopyLines(LineNumberReader reader,
int start,
int limit,
List<String> results) |
static void |
rangeCopyLines(LineNumberReader reader,
int start,
int limit,
StringBuffer str) |
static void |
rangeCopyLines(LineNumberReader reader,
int start,
int limit,
StringBuilder str) |
static byte[] |
toByteArray(InputStream input) |
static byte[] |
toByteArray(InputStream input,
int maxSize) |
static byte[] |
toByteArray(InputStream input,
int bufferSize,
int maxSize) |
static byte[] |
toByteArray(Reader reader,
Charset charset) |
static byte[] |
toByteArray(Reader reader,
Charset charset,
int maxSize) |
static byte[] |
toByteArray(Reader reader,
Charset charset,
int bufferSize,
int maxSize) |
static byte[] |
toByteArray(Reader reader,
String charset) |
static ByteBuffer |
toByteBuffer(InputStream input) |
static ByteBuffer |
toByteBuffer(InputStream input,
int maxSize) |
static ByteBuffer |
toByteBuffer(InputStream input,
int bufferSize,
int maxSize) |
static char[] |
toCharArray(InputStream input,
Charset charset) |
static char[] |
toCharArray(InputStream input,
Charset charset,
int maxSize) |
static char[] |
toCharArray(InputStream input,
Charset charset,
int bufferSize,
int maxSize) |
static char[] |
toCharArray(InputStream is,
String charset) |
static char[] |
toCharArray(Reader reader) |
static char[] |
toCharArray(Reader reader,
int maxSize) |
static char[] |
toCharArray(Reader reader,
int bufferSize,
int maxSize) |
static CharBuffer |
toCharBuffer(InputStream input,
Charset charset) |
static CharBuffer |
toCharBuffer(InputStream input,
Charset charset,
int maxSize) |
static CharBuffer |
toCharBuffer(InputStream input,
Charset charset,
int bufferSize,
int maxSize) |
static CharBuffer |
toCharBuffer(InputStream input,
String charset) |
static String |
toString(InputStream is,
Charset charset) |
static String |
toString(InputStream is,
Charset charset,
int maxSize) |
static String |
toString(InputStream is,
Charset charset,
int bufferSize,
int maxSize) |
static String |
toString(InputStream is,
String charset) |
static String |
toString(Reader reader) |
static String |
toString(Reader reader,
int maxSize) |
static String |
toString(Reader reader,
int bufferSize,
int maxSize) |
static void |
write(byte[] content,
OutputStream output) |
static void |
write(char[] content,
Writer writer) |
static void |
write(CharSequence content,
Writer writer) |
static void |
writeLine(CharSequence content,
Writer writer) |
static void |
writeLines(Collection<String> results,
OutputStream os,
Charset charset) |
static void |
writeLines(Collection<String> results,
OutputStream os,
String charset) |
static void |
writeLines(Collection<String> results,
Writer writer) |
static void |
writeLines(Enumeration<String> results,
OutputStream os,
Charset charset) |
static void |
writeLines(Enumeration<String> results,
OutputStream os,
String charset) |
static void |
writeLines(Enumeration<String> results,
Writer writer) |
static void |
writeLines(Iterator<String> results,
OutputStream os,
Charset charset) |
static void |
writeLines(Iterator<String> results,
OutputStream os,
String charset) |
static void |
writeLines(Iterator<String> results,
Writer writer) |
static void |
writeLines(Map<String,String> results,
OutputStream os,
Charset charset) |
static void |
writeLines(Map<String,String> results,
OutputStream os,
Charset charset,
String separator) |
static void |
writeLines(Map<String,String> results,
OutputStream os,
String charset) |
static void |
writeLines(Map<String,String> results,
Writer writer) |
static void |
writeLines(Map<String,String> results,
Writer writer,
String separator) |
public static final int DEFAULT_BYTE_BUFFER_SIZE
public static final int DEFAULT_CHAR_BUFFER_SIZE
public static final int EOF
public static final String NEWLINE
public static void write(byte[] content,
OutputStream output)
throws IOException
IOExceptionpublic static void write(char[] content,
Writer writer)
throws IOException
IOExceptionpublic static void write(CharSequence content, Writer writer) throws IOException
IOExceptionpublic static void writeLine(CharSequence content, Writer writer) throws IOException
IOExceptionpublic static void close(Closeable closeable) throws IOException
IOExceptionpublic static void closeQuietly(Closeable closeable)
public static void flushQuietly(OutputStream out)
public static void flush(OutputStream out) throws IOException
IOExceptionpublic static void flushQuietly(Writer writer)
public static void flush(Writer writer) throws IOException
IOExceptionpublic static void flushAndCloseQuietly(Writer writer)
public static void flushAndCloseQuietly(OutputStream os)
public static void flushAndClose(Writer writer) throws IOException
IOExceptionpublic static void flushAndClose(OutputStream os) throws IOException
IOExceptionpublic static void copyLines(Reader reader, Writer writer) throws IOException
IOExceptionpublic static long copy(Reader reader, Writer writer) throws IOException
IOExceptionpublic static long copy(Reader reader, Writer writer, int maxSize) throws IOException
IOExceptionpublic static long copy(Reader reader, Writer writer, int bufferSize, int maxSize) throws IOException
IOExceptionprivate static byte[] getByteBuffer(int bufferSize)
private static char[] getCharBuffer(int bufferSize)
public static long copy(InputStream input, OutputStream output) throws IOException
IOExceptionpublic static long copy(InputStream input, OutputStream output, int maxSize) throws IOException
IOExceptionpublic static long copy(InputStream input, OutputStream output, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static void copy(InputStream input, Writer writer, String charset) throws IOException
IOExceptionpublic static void copy(InputStream input, Writer writer, Charset charset) throws IOException
IOExceptionpublic static void copy(InputStream input, Writer writer, Charset charset, int maxSize) throws IOException
IOExceptionpublic static void copy(InputStream input, Writer writer, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static void copy(byte[] input,
Writer writer,
String charset)
throws IOException
IOExceptionpublic static void copy(byte[] input,
Writer writer,
Charset charset)
throws IOException
IOExceptionpublic static void copy(byte[] input,
Writer writer,
Charset charset,
int maxSize)
throws IOException
IOExceptionpublic static void copy(byte[] input,
Writer writer,
Charset charset,
int bufferSize,
int maxSize)
throws IOException
IOExceptionpublic static void copy(char[] input,
OutputStream output,
Charset charset)
throws IOException
IOExceptionpublic static void copy(char[] input,
OutputStream output,
String charset)
throws IOException
IOExceptionpublic static void copy(CharSequence input, OutputStream output, Charset charset) throws IOException
IOExceptionpublic static void copy(CharSequence input, OutputStream output, String charset) throws IOException
IOExceptionpublic static void copy(Reader reader, OutputStream output, Charset charset) throws IOException
IOExceptionpublic static void copy(Reader reader, OutputStream output, Charset charset, int maxSize) throws IOException
IOExceptionpublic static void copy(Reader reader, OutputStream output, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static void copy(Reader reader, OutputStream output, String charset) throws IOException
IOExceptionpublic static char[] toCharArray(InputStream input, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static char[] toCharArray(InputStream input, Charset charset, int maxSize) throws IOException
IOExceptionpublic static char[] toCharArray(InputStream input, Charset charset) throws IOException
IOExceptionpublic static char[] toCharArray(InputStream is, String charset) throws IOException
IOExceptionpublic static CharBuffer toCharBuffer(InputStream input, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static CharBuffer toCharBuffer(InputStream input, Charset charset, int maxSize) throws IOException
IOExceptionpublic static CharBuffer toCharBuffer(InputStream input, Charset charset) throws IOException
IOExceptionpublic static CharBuffer toCharBuffer(InputStream input, String charset) throws IOException
IOExceptionpublic static byte[] toByteArray(InputStream input) throws IOException
IOExceptionpublic static byte[] toByteArray(InputStream input, int maxSize) throws IOException
IOExceptionpublic static byte[] toByteArray(InputStream input, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static ByteBuffer toByteBuffer(InputStream input) throws IOException
IOExceptionpublic static ByteBuffer toByteBuffer(InputStream input, int maxSize) throws IOException
IOExceptionpublic static ByteBuffer toByteBuffer(InputStream input, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static String toString(InputStream is, Charset charset, int maxSize) throws IOException
IOExceptionpublic static String toString(InputStream is, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static String toString(InputStream is, Charset charset) throws IOException
IOExceptionpublic static String toString(InputStream is, String charset) throws IOException
IOExceptionpublic static String toString(Reader reader) throws IOException
IOExceptionpublic static String toString(Reader reader, int maxSize) throws IOException
IOExceptionpublic static String toString(Reader reader, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static char[] toCharArray(Reader reader) throws IOException
IOExceptionpublic static char[] toCharArray(Reader reader, int maxSize) throws IOException
IOExceptionpublic static char[] toCharArray(Reader reader, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static byte[] toByteArray(Reader reader, String charset) throws IOException
IOExceptionpublic static byte[] toByteArray(Reader reader, Charset charset) throws IOException
IOExceptionpublic static byte[] toByteArray(Reader reader, Charset charset, int maxSize) throws IOException
IOExceptionpublic static byte[] toByteArray(Reader reader, Charset charset, int bufferSize, int maxSize) throws IOException
IOExceptionpublic static int copyLines(Reader reader, StringBuffer str) throws IOException
IOExceptionpublic static int copyLines(InputStream in, Charset charset, StringBuffer str) throws IOException
IOExceptionpublic static int copyLines(InputStream in, String charset, StringBuffer str) throws IOException
IOExceptionpublic static int copyLines(InputStream in, Charset charset, StringBuilder str) throws IOException
IOExceptionpublic static int copyLines(InputStream in, String charset, StringBuilder str) throws IOException
IOExceptionpublic static int copyLines(Reader reader, StringBuilder str) throws IOException
IOExceptionpublic static void copyLines(Reader reader, List<String> results) throws IOException
IOExceptionpublic static void copyLines(InputStream in, Charset charset, List<String> results) throws IOException
IOExceptionpublic static void copyLines(InputStream in, String charset, List<String> results) throws IOException
IOExceptionpublic static void copyLines(byte[] bytes,
Charset charset,
List<String> results)
throws IOException
IOExceptionpublic static void copyLines(byte[] bytes,
String charset,
List<String> results)
throws IOException
IOExceptionpublic static void copyLines(char[] array,
List<String> results)
throws IOException
IOExceptionpublic static void writeLines(Map<String,String> results, Writer writer) throws IOException
IOExceptionpublic static void writeLines(Map<String,String> results, Writer writer, String separator) throws IOException
IOExceptionpublic static void writeLines(Map<String,String> results, OutputStream os, String charset) throws IOException
IOExceptionpublic static void writeLines(Map<String,String> results, OutputStream os, Charset charset) throws IOException
IOExceptionpublic static void writeLines(Map<String,String> results, OutputStream os, Charset charset, String separator) throws IOException
IOExceptionpublic static void writeLines(Enumeration<String> results, Writer writer) throws IOException
IOExceptionpublic static void writeLines(Enumeration<String> results, OutputStream os, String charset) throws IOException
IOExceptionpublic static void writeLines(Enumeration<String> results, OutputStream os, Charset charset) throws IOException
IOExceptionpublic static void writeLines(Iterator<String> results, Writer writer) throws IOException
IOExceptionpublic static void writeLines(Iterator<String> results, OutputStream os, String charset) throws IOException
IOExceptionpublic static void writeLines(Iterator<String> results, OutputStream os, Charset charset) throws IOException
IOExceptionpublic static void writeLines(Collection<String> results, Writer writer) throws IOException
IOExceptionpublic static void writeLines(Collection<String> results, OutputStream os, String charset) throws IOException
IOExceptionpublic static void writeLines(Collection<String> results, OutputStream os, Charset charset) throws IOException
IOExceptionpublic static void checkRange(int start,
int limit)
throws IOException
IOExceptionstatic boolean isValidLine(int start,
int limit,
int lineNumber)
public static void rangeCopyLines(LineNumberReader reader, int start, int limit, List<String> results) throws IOException
IOExceptionpublic static void rangeCopyLines(LineNumberReader reader, int start, int limit, StringBuffer str) throws IOException
IOExceptionpublic static void rangeCopyLines(LineNumberReader reader, int start, int limit, StringBuilder str) throws IOException
IOExceptionpublic static BufferedInputStream getBufferedInputStream(InputStream in)
public static BufferedOutputStream getBufferedOutputStream(OutputStream out)
public static BufferedInputStream getBufferedInputStream(InputStream in, int size)
public static BufferedOutputStream getBufferedOutputStream(OutputStream out, int size)
public static BufferedReader getBufferedReader(Reader reader)
public static LineNumberReader getLineNumberReader(Reader reader)
public static BufferedWriter getBufferedWriter(Writer writer)
public static BufferedReader getBufferedReader(Reader reader, int size)
public static LineNumberReader getLineNumberReader(Reader reader, int size)
public static BufferedWriter getBufferedWriter(Writer writer, int size)
public static BufferedReader getBufferedReader(InputStream in, Charset charset)
public static LineNumberReader getLineNumberReader(InputStream in, Charset charset, int size)
public static LineNumberReader getLineNumberReader(InputStream in, Charset charset)
public static LineNumberReader getLineNumberReader(InputStream in, String charset, int size)
public static LineNumberReader getLineNumberReader(InputStream in, String charset)
public static BufferedReader getBufferedReader(InputStream in, String charset)
public static BufferedReader getBufferedReader(InputStream in, Charset charset, int size)
public static BufferedReader getBufferedReader(InputStream in, String charset, int size)
public static BufferedWriter getBufferedWriter(OutputStream os, Charset charset)
public static BufferedWriter getBufferedWriter(OutputStream os, String charset)
public static BufferedWriter getBufferedWriter(OutputStream os, Charset charset, int size)
public static BufferedWriter getBufferedWriter(OutputStream os, String charset, int size)
public static ObjectInputStream getObjectInputStream(InputStream in) throws IOException
IOExceptionpublic static ObjectOutputStream getObjectOutputStream(OutputStream out) throws IOException
IOExceptionpublic static DataInputStream getDataInputStream(InputStream in)
public static DataOutputStream getDataOutputStream(OutputStream out)
public static GZIPInputStream getGZIPInputStream(InputStream in) throws IOException
IOExceptionpublic static GZIPInputStream getGZIPInputStream(InputStream in, int size) throws IOException
IOExceptionpublic static GZIPOutputStream getGZIPOutputStream(OutputStream out) throws IOException
IOExceptionpublic static GZIPOutputStream getGZIPOutputStream(OutputStream out, int size) throws IOException
IOExceptionpublic static ByteBuffer emptyByteBuffer()
Copyright © 2020. All rights reserved.