BytesWritable extends BinaryComparable implements WritableComparable<BinaryComparable> { public String toString() { StringBuffer sb = new StringBuffer(3*size); for (int idx = 0; idx < size; idx++) { if (idx != 0) { sb.append(' '); } String num = Integer.toHexString(0xff & bytes[idx]); if (num.length() < 2) { sb.append('0'); } sb.append(num); } return sb.toString(); } BytesWritable();  BytesWritable(byte[] bytes); byte[] getBytes(); int getLength(); void setSize(int size); int getCapacity(); void setCapacity(int new_cap); void set(BytesWritable newData); void replace(byte [] newArray, int size); void set(byte[] newData, int offset, int length); void readFields(DataInput in); void write(DataOutput out); int hashCode(); boolean equals(Object right_obj); String toString();  }
@Test public void testToString() { checkToString(new byte[]{0,1,2,0x10}, "00 01 02 10"); checkToString(new byte[]{-0x80, -0x7f, -0x1, -0x2, 1, 0}, "80 81 ff fe 01 00"); }