> This patch adds new getters and setters. I'd love to hear what others think > of this change.
The current (pre 0.4) semantics of the getXXX for a binary field is to return the content of that field, i.e. the byte[] that was set. ByteBuffer.capacity() returns the size of the backing array which might be more than the actual content of the buffer, therefore TBaseHelper.byteBufferToByteArray may return more data than the actual content of the field with no way to know what part of the returned byte[] contains the field's binary value. Also having setXXX(byte[]) and getXXX which returns byte[] is very misleading as people might think that the semantics are the same as before when they are not, indeed: byte[] foo = new byte[1]; struct.setXXX(foo); foo[0] = 'A'; byte[] bar = struct.getXXX(); Assert.assertEquals(foo[0], bar[0]); will fail when it succeeds today.