16 package uk.ac.cam.eng.extraction.hadoop.merge;
18 import java.io.IOException;
20 import org.apache.hadoop.io.DataOutputBuffer;
21 import org.apache.hadoop.io.WritableComparable;
22 import org.apache.hadoop.io.WritableComparator;
35 private final DataOutputBuffer buffera =
new DataOutputBuffer();
36 private final DataOutputBuffer bufferb =
new DataOutputBuffer();
43 @SuppressWarnings(
"rawtypes")
44 public
int compare(WritableComparable a, WritableComparable b) {
50 return compareBytes(buffera.getData(), 0, buffera.getLength(),
51 bufferb.getData(), 0, bufferb.getLength());
52 }
catch (IOException e) {
53 throw new RuntimeException(e);
58 public int compare(byte[] b1,
int s1,
int l1, byte[] b2,
int s2,
int l2) {
59 return compareBytes(b1, s1, l1, b2, s2, l2);