|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.file.FileUtil
File utilities.
Field Summary | |
static int |
FILE_BUFFER_SIZE
Buffer size (32KB) for file manipulation methods. |
static int |
OBJECT_BUFFER_SIZE
Buffer size (32KB) for object serialization methods. |
static int |
STRING_BUFFER_SIZE
Buffer size (32KB) for file string methods. |
Constructor Summary | |
FileUtil()
|
Method Summary | |
static void |
copy(java.io.File fileIn,
java.io.File fileOut)
Copies one file to another. |
static void |
copy(java.io.File fileIn,
java.io.File fileOut,
int bufsize)
Copies one file to another with specified buffer size. |
static void |
copy(java.lang.String fileIn,
java.lang.String fileOut)
Copies one file to another. |
static void |
copy(java.lang.String fileIn,
java.lang.String fileOut,
int bufsize)
Copies one file to another with specified buffer size. |
static byte[] |
readBytes(java.io.File file)
Reads file content as byte array. |
static byte[] |
readBytes(java.lang.String s)
Reads file content as byte array. |
static java.lang.Object |
readObject(java.lang.String f)
Reads seralized object from the file. |
static java.lang.Object |
readObject(java.lang.String f,
int bufferSize)
Reads seralized object from the file with specified buffer size |
static java.lang.String |
readString(java.io.File file)
Reads file's content into a String. |
static java.lang.String |
readString(java.io.File file,
int bufferSize)
Reads file's content into a String. |
static java.lang.String |
readString(java.io.File file,
int bufferSize,
java.lang.String encoding)
Reads file's content into a String. |
static java.lang.String |
readString(java.io.File file,
java.lang.String encoding)
Reads file's content into a String. |
static java.lang.String |
readString(java.lang.String fileName)
Reads file's content into a String. |
static java.lang.String |
readString(java.lang.String fileName,
int bufferSize)
Reads file's content into a String. |
static java.lang.String |
readString(java.lang.String fileName,
int bufferSize,
java.lang.String encoding)
Reads file's content into a String. |
static java.lang.String |
readString(java.lang.String fileName,
java.lang.String encoding)
Reads file's content into a String. |
static void |
writeBytes(java.io.File file,
byte[] source)
|
static void |
writeBytes(java.io.File file,
byte[] source,
int offset,
int len)
|
static void |
writeBytes(java.lang.String filename,
byte[] source)
|
static void |
writeBytes(java.lang.String filename,
byte[] source,
int offset,
int len)
|
static void |
writeObject(java.lang.String f,
java.lang.Object o)
Writes serializable object to a file. |
static void |
writeObject(java.lang.String f,
java.lang.Object o,
int bufferSize)
Writes serializable object to a file with specified buffer size. |
static void |
writeString(java.io.File file,
java.lang.String s)
Writes string to a file. |
static void |
writeString(java.io.File file,
java.lang.String s,
int bufferSize)
Writes string to a file. |
static void |
writeString(java.io.File file,
java.lang.String s,
int bufferSize,
java.lang.String encoding)
Writes string to a file. |
static void |
writeString(java.io.File file,
java.lang.String s,
java.lang.String encoding)
Writes string to a file. |
static void |
writeString(java.lang.String fileName,
java.lang.String s)
Writes string to a file. |
static void |
writeString(java.lang.String fileName,
java.lang.String s,
int bufferSize)
Writes string to a file. |
static void |
writeString(java.lang.String fileName,
java.lang.String s,
int bufferSize,
java.lang.String encoding)
Writes string to a file. |
static void |
writeString(java.lang.String fileName,
java.lang.String s,
java.lang.String encoding)
Writes string to a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int FILE_BUFFER_SIZE
public static int STRING_BUFFER_SIZE
public static int OBJECT_BUFFER_SIZE
Constructor Detail |
public FileUtil()
Method Detail |
public static void copy(java.lang.String fileIn, java.lang.String fileOut) throws java.io.IOException
fileIn
- input filefileOut
- output file
java.io.IOException
public static void copy(java.lang.String fileIn, java.lang.String fileOut, int bufsize) throws java.io.IOException
fileIn
- input filefileOut
- output filebufsize
- size of the buffer used for copying
java.io.IOException
public static void copy(java.io.File fileIn, java.io.File fileOut) throws java.io.IOException
fileIn
- input filefileOut
- output file
java.io.IOException
public static void copy(java.io.File fileIn, java.io.File fileOut, int bufsize) throws java.io.IOException
fileIn
- input filefileOut
- output filebufsize
- size of the buffer used for copying
java.io.IOException
public static java.lang.String readString(java.lang.String fileName) throws java.io.IOException
fileName
- name of the file to read from
java.io.IOException
public static java.lang.String readString(java.lang.String fileName, int bufferSize) throws java.io.IOException
fileName
- name of the file to read frombufferSize
- buffer size
java.io.IOException
public static java.lang.String readString(java.io.File file) throws java.io.IOException
file
- file to read
java.io.IOException
public static java.lang.String readString(java.io.File file, int bufferSize) throws java.io.IOException
file
- file to readbufferSize
- buffer size
java.io.IOException
public static void writeString(java.lang.String fileName, java.lang.String s) throws java.io.IOException
fileName
- name of the destination files
- source string
java.io.IOException
public static void writeString(java.lang.String fileName, java.lang.String s, int bufferSize) throws java.io.IOException
fileName
- name of the destination files
- source stringbufferSize
- buffer size
java.io.IOException
public static void writeString(java.io.File file, java.lang.String s) throws java.io.IOException
file
- destination files
- source string
java.io.IOException
public static void writeString(java.io.File file, java.lang.String s, int bufferSize) throws java.io.IOException
file
- destination files
- source stringbufferSize
- buffer size
java.io.IOException
public static java.lang.String readString(java.lang.String fileName, java.lang.String encoding) throws java.io.IOException
fileName
- source file nameencoding
- java encoding string
java.io.IOException
public static java.lang.String readString(java.lang.String fileName, int bufferSize, java.lang.String encoding) throws java.io.IOException
fileName
- source file namebufferSize
- buffer sizeencoding
- java encoding string
java.io.IOException
public static java.lang.String readString(java.io.File file, java.lang.String encoding) throws java.io.IOException
file
- source fileencoding
- java encoding string
java.io.IOException
public static java.lang.String readString(java.io.File file, int bufferSize, java.lang.String encoding) throws java.io.IOException
file
- source filebufferSize
- buffer sizeencoding
- java encoding string
java.io.IOException
public static void writeString(java.lang.String fileName, java.lang.String s, java.lang.String encoding) throws java.io.IOException
fileName
- destination file names
- source stringencoding
- java encoding string
java.io.IOException
public static void writeString(java.lang.String fileName, java.lang.String s, int bufferSize, java.lang.String encoding) throws java.io.IOException
fileName
- destination file names
- source stringbufferSize
- buffer sizeencoding
- java encoding string
java.io.IOException
public static void writeString(java.io.File file, java.lang.String s, java.lang.String encoding) throws java.io.IOException
file
- destination files
- source stringencoding
- java encoding string
java.io.IOException
public static void writeString(java.io.File file, java.lang.String s, int bufferSize, java.lang.String encoding) throws java.io.IOException
file
- destination files
- source stringbufferSize
- buffer sizeencoding
- java encoding string
java.io.IOException
public static void writeObject(java.lang.String f, java.lang.Object o) throws java.io.IOException
f
- name of the destination fileo
- object to write
java.io.IOException
public static void writeObject(java.lang.String f, java.lang.Object o, int bufferSize) throws java.io.IOException
f
- name of the destination fileo
- object to writebufferSize
- buffer size used for writing
java.io.IOException
public static java.lang.Object readObject(java.lang.String f) throws java.io.IOException, java.lang.ClassNotFoundException, java.io.FileNotFoundException
f
- name of the source file
java.io.IOException
java.lang.ClassNotFoundException
java.io.FileNotFoundException
public static java.lang.Object readObject(java.lang.String f, int bufferSize) throws java.io.IOException, java.lang.ClassNotFoundException, java.io.FileNotFoundException
f
- name of the source filebufferSize
- size of buffer used for reading
java.io.IOException
java.lang.ClassNotFoundException
java.io.FileNotFoundException
public static final byte[] readBytes(java.lang.String s) throws java.io.IOException
s
- file name
java.io.IOException
public static final byte[] readBytes(java.io.File file) throws java.io.IOException
file
- file to read
java.io.IOException
public static void writeBytes(java.lang.String filename, byte[] source) throws java.io.IOException
java.io.IOException
public static void writeBytes(java.io.File file, byte[] source) throws java.io.IOException
java.io.IOException
public static void writeBytes(java.lang.String filename, byte[] source, int offset, int len) throws java.io.IOException
java.io.IOException
public static void writeBytes(java.io.File file, byte[] source, int offset, int len) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |