ThreeB 1.1
Static Package Functions

Utility calss to hold a number of handy static functions. More...

List of all members.

Static Package Functions

static String read (Reader in)
static SPair getFileName (String t)

Detailed Description

Utility calss to hold a number of handy static functions.

Definition at line 45 of file three_B.java.


Member Function Documentation

static String Util::read ( Reader  in) [inline, static, package]

Read a file into a string.

It simply sidcards errors because if the file is missing from the JAR archive, then extreme badness has happened and I have no idea how to recover.

Parameters:
inFile to be read
Returns:
file contents in a string

Definition at line 53 of file three_B.java.

Referenced by ThreeBHelp::run(), and three_B::run().

    {
        try {
            final char[] buffer = new char[100]; 
            StringBuilder out = new StringBuilder(); 
            int read;
            do 
            {   
                read = in.read(buffer, 0, buffer.length);
                if (read>0)
                    out.append(buffer, 0, read);
            } while (read>=0);
            return out.toString();
        }
        catch(java.io.IOException err)
        {
            return "";
            //What do we do here?
        }
    }

The documentation for this class was generated from the following file: