public static int[] createTupleArray(final ProtobufMessages.Tuple _tuple) { int[] tuple = new int[_tuple.getHandleIdCount()]; for ( int i = 0; i < tuple.length; i++ ) { // needs to reverse the tuple elements tuple[i] = _tuple.getHandleId( tuple.length - i - 1 ); } return tuple; }