anchor.diff:                                                     throw(invalid_handoff_encoding)
                                   end;
   
  -        %% zlib encoding is a special legacy mode:
  -        BinObj              ->  do_zlib_decode(BinObj)
  +        _                   ->  lager:error("Request to decode invalid handoff object"),
  +                                throw(invalid_handoff_object)
  +
  +    %% An exception means we have a legacy handoff object:
  +    catch
  +        _:_                 -> do_zlib_decode(BinaryObject)
       end.  
   
   do_zlib_decode(BinaryObject) ->
  
positive.code:         encode_raw  -> EncodedObject = term_to_binary({ Bucket, Key, iolist_to_binary(Value) }),
                         return_encoded_binary_object(Method, EncodedObject);
  
          encode_zlib -> PBEncodedObject = riak_core_pb:encode_riakobject_pb(#riakobject_pb{bucket=Bucket, key=Key, val=Value}),
                         zlib:zip(PBEncodedObject)
      end.
  
negative.code:          encode_handoff_item/2,
           handle_exit/3,
           handle_info/2]).
  
  -export([handoff_data_encoding_method/0]).
  
  -include_lib("riak_kv_vnode.hrl").
  -include_lib("riak_kv_map_phase.hrl").
  