Index: test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java	(revision 1787)
+++ test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java	(revision 1788)
@@ -74,8 +74,9 @@
     {
         try {
             FileReader fr = new FileReader(testfile);
-            StringBuffer buf = IOUtil.getAsStringBuffer(fr, true);
-            testdocument = buf.toString();
+            testdocument = IOUtil.getAsString(fr, true);
+            //StringBuffer buf = IOUtil.getAsStringBuffer(fr, true);
+            //testdocument = buf.toString();
         } catch (IOException ioe) {
             fail("Can't read test data to run the test: " + testfile);
         }
@@ -156,7 +157,7 @@
         try {
             m.login(username, password);
             Reader r = m.read(docid);
-            String doc = readerToString(r);
+            String doc = IOUtil.getAsString(r, true);
             System.err.println(doc);
             assertTrue(doc.equals(testdocument));
 
@@ -177,10 +178,8 @@
         try {
             FileReader fr = new FileReader(queryFile);
             Reader r = m.query(fr);
-            String result = readerToString(r);
+            String result = IOUtil.getAsString(r, true);
             assertTrue(result.indexOf("obfs.100.3")!=-1);
-        } catch (MetacatAuthException mae) {
-            fail("Authorization failed:\n" + mae.getMessage());
         } catch (MetacatInaccessibleException mie) {
             fail("Metacat Inaccessible:\n" + mie.getMessage());
         } catch (Exception e) {
@@ -187,34 +186,4 @@
             fail("General exception:\n" + e.getMessage());
         }
     }
-    
-/*
- * PRIVATE METHODS
- */
-
-    /**
-     * Utility method to convert a reader to a String.
-     *
-     * @param reader the Reader to be converted
-     * @return a String representation fo the data read
-     */
-    private String readerToString(Reader reader) throws Exception
-    {
-        String response = null;
-
-        try {
-            StringWriter sw = new StringWriter();
-            int len;
-            char[] characters = new char[512];
-            while ((len = reader.read(characters, 0, 512)) != -1) {
-                sw.write(characters, 0, len);
-            }
-            response = sw.toString();
-            sw.close();
-            reader.close();
-        } catch (Exception e) {
-            throw e;
-        }
-        return response;
-    }
 }
Index: src/edu/ucsb/nceas/metacat/client/MetacatClient.java
===================================================================
--- src/edu/ucsb/nceas/metacat/client/MetacatClient.java	(revision 1787)
+++ src/edu/ucsb/nceas/metacat/client/MetacatClient.java	(revision 1788)
@@ -35,7 +35,9 @@
 import java.util.Properties;
 
 import edu.ucsb.nceas.utilities.HttpMessage;
+import edu.ucsb.nceas.utilities.IOUtil;
 
+
 /**
  *  This interface provides methods for initializing and logging in to a 
  *  Metacat server, and then querying, reading, transforming, inserting, 
@@ -154,12 +156,9 @@
     {
         Reader reader = null;
         String query = null;
-        try
-        {
-          query = readerToString(xmlQuery);
-        }
-        catch (IOException ioE)
-        {
+        try {
+          query = IOUtil.getAsString(xmlQuery, true);
+        } catch (IOException ioE) {
           throw ioE;
         }
 
@@ -315,30 +314,4 @@
         }
         return response;
     }
-    /**
-     * Utility method to convert a reader to a String.
-     *
-     * @param reader the Reader to be converted
-     * @return a String representation fo the data read
-     */
-    private String readerToString(Reader reader) throws IOException
-    {
-        String response = null;
-
-        try {
-            StringWriter sw = new StringWriter();
-            int len;
-            char[] characters = new char[512];
-            while ((len = reader.read(characters, 0, 512)) != -1) {
-                sw.write(characters, 0, len);
-            }
-            response = sw.toString();
-            sw.close();
-            reader.close();
-        } catch (IOException e) {
-            throw e;
-        }
-        return response;
-    }
-    
 }
