{
                  // Make sure they are closed no matter what bad thing happens.
                  //
                  if (inputStream != null) 
                  {
                    inputStream.close();
                  }
                  if (outputStream != null) 
                  {
                    outputStream.close();
                  }
                }