private static int compareLobContents(final IonLob lob1,final IonLob lob2){
  int in1=lob1.byteSize();
  int in2=lob2.byteSize();
  int result=(in1 - in2);
  if (result == 0) {
    final InputStream stream1=lob1.newInputStream();
    final InputStream stream2=lob2.newInputStream();
    try {
      try {
        try {
          while (result == 0) {
            in1=stream1.read();
            in2=stream2.read();
            if (in1 == -1 || in2 == -1) {
              if (in1 != -1)               result=1;
              if (in2 != -1)               result=-1;
              break;
            }
            result=(in1 - in2);
          }
        }
  finally {
          stream1.close();
        }
      }
  finally {
        stream2.close();
      }
    }
 catch (    final IOException e) {
      throw new IonException(e);
    }
  }
  return result;
}

private static int compareLobContents ( final IonLob lob1 , final IonLob lob2 ) { int in1 = lob1 . byteSize ( ) ; int in2 = lob2 . byteSize ( ) ; int result = ( in1 - in2 ) ; if ( result == 0 ) { final InputStream stream1 = lob1 . newInputStream ( ) ; final InputStream stream2 = lob2 . newInputStream ( ) ; try { try { try { while ( result == 0 ) { in1 = stream1 . read ( ) ; in2 = stream2 . read ( ) ; if ( in1 == - 1 || in2 == - 1 ) { if ( in1 != - 1 ) result = 1 ; if ( in2 != - 1 ) result = - 1 ; break ; } result = ( in1 - in2 ) ; } } finally { stream1 . close ( ) ; } } finally { stream2 . close ( ) ; } } catch ( final IOException e ) { throw new IonException ( e ) ; } } return result ; }
compare lob content by stream - - assuming non - null .
