anchor.diff:          {ok, Data} ->
               %% If the chunk is smaller than the requested size, we
               %% reached EOS.
  -            EOS = size(Data) < Blocksize,
  +            EOS = byte_size(Data) < Blocksize,
               if
                   EOS  -> file:close(FD);
                   true -> ok
  
positive.code:     end,
      State(Parser2);
  decode_unicode(#yaml_parser{raw_data = Data, raw_eos = EOS} = Parser)
    when ((EOS == false andalso size(Data) >= 4) orelse EOS == true) ->
      %% We have enough (maybe even all) data to determine the encoding.
      %% Let's check if the stream starts with a BOM.
      {Encoding, Length} = get_encoding(Data),
  
negative.code:             end;
          New_Chars ->
              %% Ok, we have more characters to scan!
              Raw_Index1 = Raw_Index + byte_size(Data),
              Parser#yaml_parser{
                raw_data   = <<>>,
                raw_idx    = Raw_Index1,
  