public class IO extends Object
Modifier and Type | Field and Description |
---|---|
static int |
bufferSize |
static String |
CRLF |
static byte[] |
CRLF_BYTES |
Constructor and Description |
---|
IO() |
Modifier and Type | Method and Description |
---|---|
static void |
close(InputStream is)
closes an input stream, and logs exceptions
|
static void |
close(OutputStream os)
closes an output stream, and logs exceptions
|
static void |
close(Reader reader)
closes a reader, and logs exceptions
|
static void |
close(Writer writer)
closes a writer, and logs exceptions
|
static void |
copy(File from,
File to)
Copy files or directories
|
static void |
copy(InputStream in,
OutputStream out)
Copy Stream in to Stream out until EOF or exception.
|
static void |
copy(InputStream in,
OutputStream out,
long byteCount)
Copy Stream in to Stream for byteCount bytes or until EOF or exception.
|
static void |
copy(Reader in,
Writer out)
Copy Reader to Writer out until EOF or exception.
|
static void |
copy(Reader in,
Writer out,
long byteCount)
Copy Reader to Writer for byteCount bytes or until EOF or exception.
|
static void |
copyDir(File from,
File to) |
static void |
copyFile(File from,
File to) |
static boolean |
delete(File file)
Delete File.
|
static InputStream |
getClosedStream() |
static PrintWriter |
getNullPrintWriter() |
static OutputStream |
getNullStream() |
static Writer |
getNullWriter() |
static byte[] |
readBytes(InputStream in) |
static String |
toString(InputStream in)
Read input stream to string.
|
static String |
toString(InputStream in,
Charset encoding)
Read input stream to string.
|
static String |
toString(InputStream in,
String encoding)
Read input stream to string.
|
static String |
toString(Reader in)
Read input stream to string.
|
public static final String CRLF
public static final byte[] CRLF_BYTES
public static final int bufferSize
public static void copy(InputStream in, OutputStream out) throws IOException
IOException
public static void copy(Reader in, Writer out) throws IOException
IOException
public static void copy(InputStream in, OutputStream out, long byteCount) throws IOException
IOException
public static void copy(Reader in, Writer out, long byteCount) throws IOException
IOException
public static void copy(File from, File to) throws IOException
from
- to
- IOException
public static void copyDir(File from, File to) throws IOException
IOException
public static void copyFile(File from, File to) throws IOException
IOException
public static String toString(InputStream in) throws IOException
IOException
public static String toString(InputStream in, String encoding) throws IOException
IOException
public static String toString(InputStream in, Charset encoding) throws IOException
IOException
public static String toString(Reader in) throws IOException
IOException
public static boolean delete(File file)
file
- The file to be deleted.public static void close(InputStream is)
is
- the input stream to closepublic static void close(Reader reader)
reader
- the reader to closepublic static void close(Writer writer)
writer
- the writer to closepublic static byte[] readBytes(InputStream in) throws IOException
IOException
public static void close(OutputStream os)
os
- the output stream to closepublic static OutputStream getNullStream()
public static InputStream getClosedStream()
public static Writer getNullWriter()
public static PrintWriter getNullPrintWriter()
Copyright © 1995-2015 Webtide. All Rights Reserved.