code: public static boolean byteArrayEquals(final byte[] lhs, final byte[] rhs) {
          if (lhs == null && rhs != null || lhs != null && rhs == null) {
              return false;
          }
          if (lhs==rhs) {
              return true;
          }
          if (lhs.length != rhs.length) {
              return false;
          }
          for(int i = 0; i<lhs.length; i++) {
              if (lhs[i]!=rhs[i]) {
                  return false;
              }
          }
          return true;
      }
docs: check that two byte arrays are equal.  They may be <code>null</code>.
  
  @param lhs a byte array
  @param rhs another byte array.
  @return <code>true</code> if they are both equal (or both
  <code>null</code>)