anchor.diff:  %%% API
   %%%===================================================================
   
  --spec open_archive() -> state().
  -open_archive() ->
  -    open_archive(#{gzip => true}).
  -
  -
  --spec open_archive(options()) -> state().
  -open_archive(Options) ->
  +-spec open_archive_stream() -> state().
  +open_archive_stream() ->
  +    open_archive_stream(#{gzip => true}).
  +
  +
  +-spec open_archive_stream(options()) -> state().
  +open_archive_stream(Options) ->
       ZStream = case maps:get(gzip, Options, false) of
           false -> undefined;
           true ->
  
positive.code:             {?FILE_TYPE_FLAG, Filename}
      end,
      file_header(FinalFilename, byte_size(Filename), FileSize, Mode, Timestamp, Type).
  
  
  %% @private
  -spec data_padding(state() | non_neg_integer()) -> bytes().
  data_padding(#state{current_file_bytes = FileSize}) ->
      data_padding(FileSize);
  data_padding(FileSize) when FileSize rem ?BLOCK_SIZE == 0 -> 
      <<>>;
  data_padding(FileSize) ->
      BytesToFill = (?BLOCK_SIZE - FileSize rem ?BLOCK_SIZE),
      binary:copy(?NUL, BytesToFill).
  
  
  %% @private
  -spec ending_marker() -> bytes().
  ending_marker() ->
      binary:copy(?NUL, 2 * ?BLOCK_SIZE).
  
  %% @private
  -spec file_header(binary(), FilenameSize :: non_neg_integer(), FileSize :: non_neg_integer(), 
  
negative.code:     append_to_file_content(State, Data, byte_size(Data)).
  
  -spec append_to_file_content(state(), bytes(), non_neg_integer()) -> state().
  append_to_file_content(#state{current_file_size = CurrentFileSize} = State, Data, DataSize) ->
      write_to_buffer(State#state{current_file_size = CurrentFileSize + DataSize}, Data).
  
  
  -spec close_archive_stream(state()) -> bytes().
  close_archive_stream(#state{zstream = ZStream} = State) ->
      Padding = data_padding(State),
      EofMarker = ending_marker(),
      State2 = write_to_buffer(State, <<Padding/binary, EofMarker/binary>>, finish),
      ZStream =/= undefined andalso zlib:close(ZStream),
      {FinalBytes, _} = flush(State2),
      FinalBytes.
  
  
  -spec flush(state()) -> {bytes(), state()}.
  flush(#state{buffer = Bytes} = State) ->
      {Bytes, State#state{buffer = <<>>}}.
  
  
  %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  
  %% @private
  -spec file_header(binary(), FileSize :: non_neg_integer(), Mode :: non_neg_integer(), 
  