com.tekann.codegen.pda.util
Class FileUtil

java.lang.Object
  extended by com.tekann.codegen.pda.util.FileUtil

public class FileUtil
extends java.lang.Object

Utilities for I/O.

Author:
evandro

Constructor Summary
FileUtil()
           
 
Method Summary
static totalcross.io.ByteArrayStream getFileData(totalcross.io.File file)
          Read the file data from the given File.
static totalcross.io.ByteArrayStream getFileData(totalcross.io.File file, boolean delete)
          Read the file data from the given File.
static totalcross.io.ByteArrayStream getFileData(java.lang.String filePath)
          Get file data using a ByteArrayStream to read its data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

getFileData

public static totalcross.io.ByteArrayStream getFileData(java.lang.String filePath)
                                                 throws totalcross.io.IllegalArgumentIOException,
                                                        totalcross.io.IOException
Get file data using a ByteArrayStream to read its data.

Parameters:
filePath - File path.
Returns:
A byte array
Throws:
totalcross.io.IllegalArgumentIOException
totalcross.io.IOException

getFileData

public static totalcross.io.ByteArrayStream getFileData(totalcross.io.File file)
                                                 throws totalcross.io.IllegalArgumentIOException,
                                                        totalcross.io.IOException
Read the file data from the given File.
The file MUST be passed in the File.READ_WRITE mode, otherwise
the ByteArrayStream will not be corrected read.
After the operation is finished, the file is closed.

Parameters:
file -
Returns:
Throws:
totalcross.io.IllegalArgumentIOException
totalcross.io.IOException

getFileData

public static totalcross.io.ByteArrayStream getFileData(totalcross.io.File file,
                                                        boolean delete)
                                                 throws totalcross.io.IllegalArgumentIOException,
                                                        totalcross.io.IOException
Read the file data from the given File.
The file MUST be passed in the File.READ_WRITE mode, otherwise
the ByteArrayStream will not be corrected read.
If the delete argument is true then the file will be deleted after
reading its data, otherwise the file will be only closed.

Parameters:
file -
delete -
Returns:
Throws:
totalcross.io.IllegalArgumentIOException
totalcross.io.IOException