ByteArrayPointable extends AbstractPointable implements IHashable, IComparable, Serializable { @Override public int compareTo(IPointable pointer) { return compareTo(pointer.getByteArray(), pointer.getStartOffset(), pointer.getLength()); }  @Override int compareTo(IPointable pointer); @Override int compareTo(byte[] thatBytes, int thatStart, int thatLength); int getContentLength(); int getMetaLength(); @Override int hash(); @Override int getLength(); int getContentStartOffset(); static byte[] copyContent(ByteArrayPointable bytePtr); static ByteArrayPointable generatePointableFromPureBytes(byte[] bytes); static ByteArrayPointable generatePointableFromPureBytes(byte[] bytes, int start, int length); static int getContentLength(byte[] bytes, int offset); static int getNumberBytesToStoreMeta(int length); static int normalize(byte[] bytesPtr, int start); static final ITypeTraits TYPE_TRAITS; static final IPointableFactory FACTORY; }
@Test public void testCompareTo() throws Exception { ByteArrayPointable byteArrayPointable = ByteArrayPointable .generatePointableFromPureBytes(new byte[] { 1, 2, 3, 4 }); testEqual(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 1, 2, 3, 4 })); testLessThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 2 }, 0, 1)); testLessThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 1, 2, 3, 5 })); testLessThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 1, 2, 3, 4, 5 })); testGreaterThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] {})); testGreaterThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 0 })); testGreaterThan(byteArrayPointable, ByteArrayPointable.generatePointableFromPureBytes(new byte[] { 1, 2, 3 })); }