Пример #1
0
 public override void close()
 {
     lock (@lock)
     {
         @in.close();
     }
 }
Пример #2
0
 public override void close()
 {
     lock (@lock)
     {
         if (!isClosed())
         {
             @in.close();
             buf = null;
         }
     }
 }
Пример #3
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();
     }
 }