IOToolspublic class IOTools extends Object Contains commonly needed I/O-related methods |
Fields Summary |
---|
protected static final int | DEFAULT_BUFFER_SIZE |
Constructors Summary |
---|
private IOTools() //4k
//Ensure non-instantiability
|
Methods Summary |
---|
public static void | flow(java.io.Reader reader, java.io.Writer writer, char[] buf)Read input from reader and write it to writer until there is no more
input from reader.
int numRead;
while ( (numRead = reader.read(buf) ) >= 0) {
writer.write(buf, 0, numRead);
}
| public static void | flow(java.io.Reader reader, java.io.Writer writer)
char[] buf = new char[DEFAULT_BUFFER_SIZE];
flow( reader, writer, buf );
| public static void | flow(java.io.InputStream is, java.io.OutputStream os, byte[] buf)Read input from input stream and write it to output stream
until there is no more input from input stream.
int numRead;
while ( (numRead = is.read(buf) ) >= 0) {
os.write(buf, 0, numRead);
}
| public static void | flow(java.io.InputStream is, java.io.OutputStream os)
byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
flow( is, os, buf );
|
|