Example #1
0
 /// <summary>Returns the remainder of 'reader' as a string, closing it when done.</summary>
 /// <remarks>Returns the remainder of 'reader' as a string, closing it when done.</remarks>
 /// <exception cref="System.IO.IOException"></exception>
 public static string readFully(java.io.Reader reader)
 {
     try
     {
         java.io.StringWriter writer = new java.io.StringWriter();
         char[] buffer = new char[1024];
         int    count;
         while ((count = reader.read(buffer)) != -1)
         {
             writer.write(buffer, 0, count);
         }
         return(writer.ToString());
     }
     finally
     {
         reader.close();
     }
 }
Example #2
0
		/// <summary>Returns the remainder of 'reader' as a string, closing it when done.</summary>
		/// <remarks>Returns the remainder of 'reader' as a string, closing it when done.</remarks>
		/// <exception cref="System.IO.IOException"></exception>
		public static string readFully(java.io.Reader reader)
		{
			try
			{
				java.io.StringWriter writer = new java.io.StringWriter();
				char[] buffer = new char[1024];
				int count;
				while ((count = reader.read(buffer)) != -1)
				{
					writer.write(buffer, 0, count);
				}
				return writer.ToString();
			}
			finally
			{
				reader.close();
			}
		}