public static String readCompleteFileOrURL(String address) throws IOException {
        InputStream stream = getInputStream(address);   // open file

        // read each letter into a buffer
        StringBuffer buffer = new StringBuffer();
        while (true) {
            int ch = stream.read();
            if (ch < 0) {
                break;
            }

            buffer.append((char) ch);
        }

        return buffer.toString();
    }