@Override public boolean equals(Object other) { return (compareTo(other) == 0); }
return ((DataByteArray)o1).compareTo(o2);
/** * This calls the compareTo method of the encapsulated DataByteArray. * * @param context the context the method is being executed in * @param arg a RubyDataByteArray or byte array to compare to the * encapsulated DataByteArray * @return the result of compareTo on the encapsulated DataByteArray and arg */ @JRubyMethod public RubyFixnum compareTo(ThreadContext context, IRubyObject arg) { int compResult; if (arg instanceof RubyDataByteArray) { compResult = internalDBA.compareTo(((RubyDataByteArray)arg).getDBA()); } else { compResult = internalDBA.compareTo(new DataByteArray((byte[])arg.toJava(byte[].class))); } return RubyFixnum.newFixnum(context.getRuntime(), compResult); }