code: static public boolean isByteArray(Object x) {
          if (x == null)
              return false;
          Class c = x.getClass();
          if (c.isArray()) {
              Class ct = c.getComponentType();
              if (ct == Byte.TYPE) {
                  return true;
              }
          }
          return false;
      }
docs: ************************************************************************
  isByteArray Find out if object is a byte array so we can avoid serialization
  and subsequent deserialization.
  
  @param x the Object to inspect
  @return true if x is a byte array (byte[])
  @return false if x is not a byte array
  ***********************************************************************