anchor.diff:  
   %% @doc Convert riak object to binary form
   -spec to_binary(binary_version(), riak_object()) -> binary().
  -to_binary(v0, RObj) ->
  +-spec to_binary(binary_version(), riak_object(), encoding()) -> binary().
  +to_binary(Vers, RObj) ->
  +    to_binary(Vers, RObj, erlang).
  +to_binary(v0, RObj, _) ->
       term_to_binary(RObj);
  -to_binary(v1, #r_object{contents=Contents, vclock=VClock}) ->
  -    new_v1(VClock, Contents).
  +to_binary(v1, #r_object{contents=Contents, vclock=VClock}, Enc) ->
  +    new_v1(VClock, Contents, Enc).
   
   %% @doc convert a binary encoded riak object to a different
   %% encoding version. If the binary is already in the desired
  
positive.code: -type index_op() :: add | remove.
  -type index_value() :: integer() | binary().
  -type binary_version() :: v0 | v1.
  
  -define(MAX_KEY_SIZE, 65536).
  
  
negative.code: %% -type binobj_value()      :: <<ValueLen:32, ValueBin/binary, MetaLen:32,
  %%                                [binobj_meta()]>>.
  %% -type binobj()            :: <<binobj_header(), [binobj_value()]>>.
  new_v1(Vclock, Siblings, Enc) ->
      VclockBin = term_to_binary(Vclock),
      VclockLen = byte_size(VclockBin),
      SibCount = length(Siblings),
      SibsBin = bin_contents(Siblings, Enc),
      <<?MAGIC:8/integer, ?V1_VERS:8/integer, VclockLen:32/integer, VclockBin/binary, SibCount:32/integer, SibsBin/binary>>.
  
  bin_content(#r_content{metadata=Meta, value=Val}, Enc) ->
      ValBin = encode(Val, Enc),
      ValLen = byte_size(ValBin),
      MetaBin = meta_bin(Meta),
      MetaLen = byte_size(MetaBin),
      <<ValLen:32/integer, ValBin:ValLen/binary, MetaLen:32/integer, MetaBin:MetaLen/binary>>.
  
  bin_contents(Contents, Enc) ->
      F = fun(Content, Acc) ->
                  <<Acc/binary, (bin_content(Content, Enc))/binary>>
          end,
      lists:foldl(F, <<>>, Contents).
  
  