Hmm..
Oder mach ne Ansiversion daraus
Delphi-Quellcode:
function FindInMemStream(Stream: TBytesStream; What: AnsiString): Integer;
var
bufBuffer, bufBuffer2: array [0 .. 254] of AnsiChar;
i: Integer;
begin
Result := 0;
i := 0;
FillChar(bufBuffer, 255, #0);
FillChar(bufBuffer2, 255, #0);
StrPCopy(@bufBuffer2, What);
Stream.Position := 0;
while Stream.Position <> Stream.Size do
begin
Stream.Read(bufBuffer[0], Length(What));
if CompareMem(@bufBuffer, @bufBuffer2, Length(What)) then
begin
Result := Stream.Position - Length(What);
Exit;
end;
i := i + 1;
Stream.Seek(i, 0)
end;
end;
Somit würdest Du dann
UniCode verlieren...
Oder alternativ auf WideChar....