utils
Class FileReader

java.lang.Object
  extended by utils.FileReader

public class FileReader
extends java.lang.Object

utils for reading files


Constructor Summary
FileReader()
           
 
Method Summary
static byte[] getBytesFromFile(java.io.File file)
           
static byte[] getBytesFromStream(java.io.InputStream is, long length)
          get byte array from stream
static java.lang.String getContents(java.io.File aFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReader

public FileReader()
Method Detail

getBytesFromFile

public static byte[] getBytesFromFile(java.io.File file)
                               throws java.io.IOException
Parameters:
file - File object
Returns:
the contents of the file in a byte array.
Throws:
java.io.IOException - if it can not get byte array from stream
See Also:
File

getBytesFromStream

public static byte[] getBytesFromStream(java.io.InputStream is,
                                        long length)
                                 throws java.io.IOException
get byte array from stream

Parameters:
is - InputStream object
length - length of getting object
Returns:
reading contents in a byte array
Throws:
java.io.IOException - could not completely read stream
See Also:
InputStream

getContents

public static java.lang.String getContents(java.io.File aFile)
Parameters:
aFile - File object
Returns:
the content of file in a string
See Also:
File