|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.util.io.FileUtils
public class FileUtils
Name: FileUtils
Description: Class providing common utility methods for file handling.
Field Summary | |
---|---|
static int |
IO_BUFFER_SIZE
The I/O buffer size. |
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static int |
copyFile(File src,
File dst)
Copies the contents of the given file src into
the given file dst . |
static int |
copyFromBytes(byte[] bytes,
File dest)
Copies the contents of the given byte array bytes into
the given output file file . |
static int |
copyFromReader(Reader reader,
File dest)
Copies the contents of the given reader reader into
the given output file file . |
static int |
copyFromStream(InputStream is,
File dest)
Copies the contents of the given input stream is into
the given output file file . |
static int |
copyStreamToStream(InputStream is,
OutputStream os,
boolean closeOs)
Copies the contents of the given input stream is into
the given output file file . |
static int |
copyToStream(File src,
OutputStream os)
Copies the contents of the given file src into
the given output stream os . |
static byte[] |
loadFile(File file)
Loads the contents of the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IO_BUFFER_SIZE
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static final byte[] loadFile(File file) throws IOException
file
- The file to load.
IOException
- In case the loading of the file failed.public static final int copyFile(File src, File dst) throws IOException
src
into
the given file dst
.
src
- The file to copy from.dst
- The file to copy to.
IOException
- In case the loading of the file failed.public static final int copyToStream(File src, OutputStream os) throws IOException
src
into
the given output stream os
.
src
- The file to copy from.os
- The stream to write to.
IOException
- In case the loading of the file failed.public static final int copyFromBytes(byte[] bytes, File dest) throws IOException
bytes
into
the given output file file
.
bytes
- The bytes to copy.dest
- The file to write to.
IOException
- In case the loading of the file failed.public static final int copyFromStream(InputStream is, File dest) throws IOException
is
into
the given output file file
.
is
- The input stream to copy from.dest
- The file to write to.
IOException
- In case the loading of the file failed.public static final int copyStreamToStream(InputStream is, OutputStream os, boolean closeOs) throws IOException
is
into
the given output file file
.
is
- The input stream to copy from.os
- The output stream to write to.closeOs
- Tells, whether or not to close the output stream, false keeps it open.
IOException
- In case the loading of the file failed.public static final int copyFromReader(Reader reader, File dest) throws IOException
reader
into
the given output file file
.
reader
- The reader to copy from.dest
- The file to write to.
IOException
- In case the loading of the file failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |