@SuppressWarnings("unchecked") private boolean isTokenValidForCompression(byte[] blob){
  if (blob == null) {
    return false;
  }
  String contents;
  try {
    contents=blobUtils.toUTF8(blob);
  }
 catch (  UnsupportedEncodingException e) {
    return false;
  }
  if (!contents.startsWith("{")) {
    return false;
  }
  if (!contents.endsWith("}")) {
    return false;
  }
  Set<String> keys=new HashSet<String>();
  keys.addAll(replacement.keySet());
  keys.addAll(replacement.values());
  for (  String key : keys) {
    if (contents.contains(key)) {
      return true;
    }
  }
  return false;
}

@ SuppressWarnings ( "unchecked" ) private boolean isTokenValidForCompression ( byte [ ] blob ) { if ( blob == null ) { return false ; } String contents ; try { contents = blobUtils . toUTF8 ( blob ) ; } catch ( UnsupportedEncodingException e ) { return false ; } if ( ! contents . startsWith ( "{" ) ) { return false ; } if ( ! contents . endsWith ( "}" ) ) { return false ; } Set < String > keys = new HashSet < String > ( ) ; keys . addAll ( replacement . keySet ( ) ) ; keys . addAll ( replacement . values ( ) ) ; for ( String key : keys ) { if ( contents . contains ( key ) ) { return true ; } } return false ; }
a heuristic for identifying the contents of the binary data . the objective is to determine if the binary data contains a serialised session object .
