ThreeB 1.1
|
Utility calss to hold a number of handy static functions. More...
Static Package Functions | |
static String | read (Reader in) |
static SPair | getFileName (String t) |
Utility calss to hold a number of handy static functions.
Definition at line 45 of file three_B.java.
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.
in | File to be read |
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? } }