anchor.diff:  			FResult = end_of_part(Rest, Pattern),
   			{body, PBody, fun () -> FResult end};
   		nomatch ->
  -			PartialLength = byte_size(Bin) - PSize + 1,
  -			<<PBody:PartialLength/binary, Rest/binary>> = Bin,
  -			{body, PBody, fun () -> parse_body(Rest, Pattern) end}
  +			case suffix_match(Bin, Pattern) of
  +				nomatch ->
  +					%% Prefix of boundary not found at end of input. it's
  +					%% safe to return the whole binary. Saves copying of
  +					%% next input onto tail of current input binary.
  +					{body, Bin, fun () -> parse_body(<<>>, Pattern) end};
  +				{BoundaryStart, Len} ->
  +					PBody = binary:part(Bin, BoundaryStart, Len),
  +					Rest = binary:part(Bin, 0, BoundaryStart),
  +					{body, PBody, fun () -> parse_body(Rest, Pattern) end}
  +			end
   	end;
   parse_body(Bin, Pattern) ->
   	more(Bin, fun (NewBin) -> parse_body(NewBin, Pattern) end).
   
  --spec end_of_part(binary(), pattern()) -> end_of_part().
  +-spec end_of_part(binary(), patterns()) -> end_of_part().
   end_of_part(Bin, Pattern) ->
   	{end_of_part, fun () -> parse_boundary_tail(Bin, Pattern) end}.
   
  --spec skip(binary(), pattern()) -> more(part_result()).
  -skip(Bin, Pattern = {P, PSize}) ->
  +-spec skip(binary(), patterns()) -> more(part_result()).
  +skip(Bin, Pattern = {{P, PSize}, _}) ->
   	case binary:match(Bin, P) of
   		{BoundaryStart, _Length} ->
   			% Boundary found, proceed with parsing of the next part.
  
positive.code: 	),
  	iolist_to_binary(Title).
  
  -endif.
  
negative.code: 	% considered part of the boundary so EOL needs to be searched again.
  	parse_boundary_eol(Bin, Pattern).
  
  -spec parse_headers(binary(), patterns()) -> more(part_result()).
  parse_headers(Bin, Pattern) ->
    parse_headers(Bin, Pattern, []).
  
  -spec parse_headers(binary(), patterns(), http_headers()) -> more(part_result()).
  parse_headers(Bin, Pattern, Acc) ->
  	case erlang:decode_packet(httph_bin, Bin, []) of
  		{ok, {http_header, _, Name, _, Value}, Rest} ->
  