@Override public void assertEquals(String message,Object expectedObj,Object actualObj) throws RuntimeException {
  FileObject fo1=(FileObject)expectedObj;
  FileObject fo2=(FileObject)actualObj;
  InputStream is1=null;
  InputStream is2=null;
  ByteArrayOutputStream bs1=null;
  ByteArrayOutputStream bs2=null;
  try {
    is1=fo1.openStream();
    is2=fo2.openStream();
    bs1=new ByteArrayOutputStream();
    bs2=new ByteArrayOutputStream();
    Tools.copyStreamSynchronously(is1,bs1,true);
    Tools.copyStreamSynchronously(is2,bs2,true);
    byte[] fileData1=bs1.toByteArray();
    byte[] fileData2=bs2.toByteArray();
    RapidAssert.assertArrayEquals("file object data",fileData1,fileData2);
  }
 catch (  OperatorException e) {
    throw new RuntimeException("Stream Error");
  }
catch (  IOException e) {
    throw new RuntimeException("Stream Error");
  }
 finally {
    if (is1 != null) {
      try {
        is1.close();
      }
 catch (      IOException e) {
      }
    }
    if (is2 != null) {
      try {
        is2.close();
      }
 catch (      IOException e) {
      }
    }
    if (bs1 != null) {
      try {
        bs1.close();
      }
 catch (      IOException e) {
      }
    }
    if (bs2 != null) {
      try {
        bs2.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

@ Override public void assertEquals ( String message , Object expectedObj , Object actualObj ) throws RuntimeException { FileObject fo1 = ( FileObject ) expectedObj ; FileObject fo2 = ( FileObject ) actualObj ; InputStream is1 = null ; InputStream is2 = null ; ByteArrayOutputStream bs1 = null ; ByteArrayOutputStream bs2 = null ; try { is1 = fo1 . openStream ( ) ; is2 = fo2 . openStream ( ) ; bs1 = new ByteArrayOutputStream ( ) ; bs2 = new ByteArrayOutputStream ( ) ; Tools . copyStreamSynchronously ( is1 , bs1 , true ) ; Tools . copyStreamSynchronously ( is2 , bs2 , true ) ; byte [ ] fileData1 = bs1 . toByteArray ( ) ; byte [ ] fileData2 = bs2 . toByteArray ( ) ; RapidAssert . assertArrayEquals ( "file object data" , fileData1 , fileData2 ) ; } catch ( OperatorException e ) { throw new RuntimeException ( "Stream Error" ) ; } catch ( IOException e ) { throw new RuntimeException ( "Stream Error" ) ; } finally { if ( is1 != null ) { try { is1 . close ( ) ; } catch ( IOException e ) { } } if ( is2 != null ) { try { is2 . close ( ) ; } catch ( IOException e ) { } } if ( bs1 != null ) { try { bs1 . close ( ) ; } catch ( IOException e ) { } } if ( bs2 != null ) { try { bs2 . close ( ) ; } catch ( IOException e ) { } } } }
tests the two file objects for equality by testing the
