uk.ac.umist.co.brailletrans.utils
Class Utils

java.lang.Object
  |
  +--uk.ac.umist.co.brailletrans.utils.Utils

public final class Utils
extends java.lang.Object

Utility methods used by various classes for getting text from files, converting data types and so on.


Method Summary
static int[] GetIntArrayInput(java.lang.String filename)
          Reads an array of ints from a local file using BufferedInputStream.
static java.lang.String GetStringInput(java.lang.String filename)
          Reads text as a String from a local file using java.io.BufferedReader.
static void PutStringOutput(java.lang.String filename, java.lang.String toWrite)
          Writes a String to a local file using BufferedWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

PutStringOutput

public static void PutStringOutput(java.lang.String filename,
                                   java.lang.String toWrite)
Writes a String to a local file using BufferedWriter
Parameters:
filename - String containing full path and name of file to write to.
toWrite - String to be written to file in filename.

GetStringInput

public static java.lang.String GetStringInput(java.lang.String filename)
Reads text as a String from a local file using java.io.BufferedReader.
Parameters:
filename - String containing the full path and filename of the local file to read text from.
Returns:
toReturn The String read from the local file.

GetIntArrayInput

public static int[] GetIntArrayInput(java.lang.String filename)
Reads an array of ints from a local file using BufferedInputStream.
Parameters:
filename - String containing the full path and filename of the local file to read from.
Returns:
toReturn An int[] containing ints read from file.