anchor.diff:      riak_object() | {error, 'bad_object_format'}.
   from_binary(_B,_K,<<131, _Rest/binary>>=ObjTerm) ->
       binary_to_term(ObjTerm);
  -from_binary(B,K,<<?MAGIC:8/integer, 1:8/integer, Rest/binary>>=_ObjBin) ->
  +
  +from_binary(B,K,<<?MAGIC:8/integer, _BinType:8/integer, Rest/binary>>=_ObjBin) ->
       %% Version 1 of binary riak object
       case Rest of
           <<VclockLen:32/integer, VclockBin:VclockLen/binary, SibCount:32/integer, SibsBin/binary>> ->
  
positive.code: fold_meta_to_bin(?MD_DELETED, _, {{Vt,_Del,Lm},RestBin}) ->
      {{Vt, <<0>>, Lm}, RestBin};
  fold_meta_to_bin(Key, Value, {{_Vt,_Del,_Lm}=Elems,RestBin}) ->
      ValueBin = encode_maybe_binary(Value),
      ValueLen = byte_size(ValueBin),
      KeyBin = encode_maybe_binary(Key),
      KeyLen = byte_size(KeyBin),
      MetaBin = <<KeyLen:32/integer, KeyBin/binary, ValueLen:32/integer, ValueBin/binary>>,
      {Elems, <<RestBin/binary, MetaBin/binary>>}.
  
  encode_maybe_binary(Bin) when is_binary(Bin) ->
      <<1, Bin/binary>>;
  encode_maybe_binary(Bin) ->
      <<0, (term_to_binary(Bin))/binary>>.
  
  decode_maybe_binary(<<1, Bin/binary>>) ->
      Bin;
  decode_maybe_binary(<<0, Bin/binary>>) ->
      binary_to_term(Bin).
  
  %% Update X-Riak-VTag and X-Riak-Last-Modified in the object's metadata, if
  %% necessary.
  
negative.code: -type index_value() :: integer() | binary().
  -type binary_version() :: v0 | v1.
  
  -define(VAL_ENCODING, <<"val-encoding">>).
  -define(MAX_KEY_SIZE, 65536).
  
  -define(LASTMOD_LEN, 29). %% static length of rfc1123_date() type. Hard-coded in Erlang.
  