anchor.diff:      decode_file(FileName, FileSize, ?ECODE_CLASS, ?ECODE_PARAMS).
   decode_file(FileName, FileSize, Coding, CodingParams) ->
       AvailList = check_available_blocks(FileName, 14, []),
  -%    BlockList = read_blocks(FileName, AvailList),
       BlockWithIdList = read_blocks(FileName, AvailList),
  -%    {Time, {ok, FileContent}} = timer:tc(?MODULE, decode, [BlockList, AvailList, FileSize, Coding, CodingParams]),
       {Time, {ok, FileContent}} = timer:tc(?MODULE, decode, [BlockWithIdList, FileSize, Coding, CodingParams]),
       io:format("Duration ~p~n", [Time]),
       DecodeName = FileName ++ ".dec",
  
positive.code: %% @doc Actual Encoding with Jerasure (NIF)
  %%
  -spec(encode(Bin, TotalSize, Coding, CodingParams) ->
              {ok, [binary()]} | {error, any()} when Bin::binary(),
                                                   TotalSize::integer(),
                                                   Coding::atom(),
                                                   CodingParams::{integer(), integer(), integer()}).
  encode(_Bin,_TotalSize,_Coding,_CodingParams) ->
      exit(nif_library_not_loaded).
  
  %% @doc Actual Decoding with Jerasure (NIF)
  %%
  -spec(decode(BlockList, IdList, FileSize, Coding, CodingParams) ->
              {ok, binary()} | {error, any()} when BlockList::[binary()],
                                                   IdList::[integer()],
                                                   FileSize::integer(),
                                                   Coding::atom(),
                                                   CodingParams::{integer(), integer(), integer()}).
  decode(_BlockList,_IdList,_FileSize,_Coding,_CodingParams) ->
      exit(nif_library_not_loaded).
  
  %% @doc Actual Decoding with Jerasure (NIF) [{ID, Bin}] Interface
  %%
  -spec(decode(BlockWithIdList, FileSize, Coding, CodingParams) ->
              {ok, binary()} | {error, any()} when BlockWithIdList::[{binary(), integer()}],
                                                   FileSize::integer(),
                                                   Coding::atom(),
                                                   CodingParams::{integer(), integer(), integer()}).
  decode(BlockWithIdList, FileSize, Coding, CodingParams) ->
      SortFun = fun (A ,B) ->
                        {_BlockA, IdA} = A,
                        {_BlockB, IdB} = B,
                        IdA =< IdB
                end,
      SortedList = lists:sort(SortFun, BlockWithIdList),
      {BlockList, IdList} = lists:unzip(SortedList),
      decode(BlockList, IdList, FileSize, Coding, CodingParams).
  
  %% @doc Repeat the Encoding Process
  %% @private
  
negative.code: -export([encode_file/3,decode_file/4]).
  -export([write_blocks/3]).
  -export([encode/4, decode/4, decode/5]).
  -export([repair_one/4, repair_one/5]).
  -export([benchmark_encode/4]).
  
  -on_load(init/0).
  