Code example for InputStreamReader

Methods: close

0
    finally 
    { 
      goldInput.close();
    } 
 
    final Reader reader = new InputStreamReader(new ByteArrayInputStream(goldData), "UTF-8");
    final ByteArrayInputStream inputStream = new ByteArrayInputStream(reportOutput);
    final Reader report = new InputStreamReader(inputStream, "UTF-8");
    try 
    { 
      XMLAssert.assertXMLEqual("File " + goldSample + " failed", new Diff(reader, report), true);
    } 
    catch (AssertionFailedError afe)
    { 
      debugOutput(reportOutput, goldSample);
      throw afe;
    } 
    finally 
    { 
      reader.close();
    } 
  } 
 
  private void debugOutput(final byte[] reportOutput, final File goldSample) throws IOException
  {