|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jlayercheck.util.io.IOHelper
public class IOHelper
Some helper methods for file and io handling.
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
Buffer size for IO. |
| Constructor Summary | |
|---|---|
IOHelper()
|
|
| Method Summary | |
|---|---|
static void |
close(InputStream stream)
Close stream, catching all exceptions. |
static void |
close(OutputStream stream)
Close stream, catching all exceptions. |
static void |
close(Reader reader)
Close reader, catching all exceptions. |
static void |
close(Writer writer)
Close writer, catching all exceptions. |
static void |
copy(File from,
File to)
Copy file to another file |
static void |
copy(InputStream in,
OutputStream out)
Copy content from in to out. |
static void |
copy(Reader in,
Writer out)
Copy content from in to out. |
static void |
copy(URL from,
File to)
Copy content from URL to a file |
static String |
readContent(URL url)
Read content from URL into string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BUFFER_SIZE
| Constructor Detail |
|---|
public IOHelper()
| Method Detail |
|---|
public static void close(OutputStream stream)
stream - public static void close(InputStream stream)
stream - public static void close(Reader reader)
reader - public static void close(Writer writer)
writer -
public static void copy(InputStream in,
OutputStream out)
throws IOException
in - The stream to read fromout - The stream to write to
IOException
public static void copy(Reader in,
Writer out)
throws IOException
in - The reader to read fromout - The writer to write to
IOException
public static void copy(File from,
File to)
from - source fileto - destination file
public static void copy(URL from,
File to)
from - sourceto - destination filepublic static String readContent(URL url)
url - URL to read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||