anchor.diff:  	 decode_open_type_as_binary/3]).
   
   -export([decode_primitive_incomplete/2,decode_selective/2]).
  -
  --export([is_nif_loadable/0]).
    
   % the encoding of class of tag bits 8 and 7 
   -define(UNIVERSAL,   0). 
  
positive.code: encode([Tlv],Method) ->
      encode(Tlv,Method);
  encode(Tlv, nif) ->
      case is_nif_loadable() of
  	true ->
  	    asn1rt_nif:encode_ber_tlv(Tlv);
  	false ->
  	    encode_erl(Tlv)
      end;
  encode(Tlv, _) ->
      encode_erl(Tlv).
  
  
negative.code: 
  %% asn1-1.7
  decode(B, nif) ->
      case asn1rt_nif:decode_ber_tlv(B) of
  	{error, Reason} -> handle_error(Reason, B);
  	Else -> Else
      end;
  decode(B,erlang) when is_binary(B) ->
      decode_primitive(B);
  decode(Tlv,erlang) ->
      {Tlv,<<>>}.
  
  handle_error([],_)->
      exit({error,{asn1,{"memory allocation problem"}}});
  