AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Look for specified sequence in stream

Ein Thema von WojTec · begonnen am 19. Sep 2013 · letzter Beitrag vom 19. Sep 2013
 
Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.492 Beiträge
 
Delphi 7 Enterprise
 
#6

AW: Look for specified sequence in stream

  Alt 19. Sep 2013, 14:57
You should eliminate object access there by copying the values to local variables.
Delphi-Quellcode:
var
  Position, Size : int64;
  MemoryPtr : Pointer;
  PatternLen : int64;
  MaxPosition : int64;
begin
  ...
  Memory := TMemoryStream.Create;
  try
    Memory.CopyFrom(AStream, 0);
    Memory.Position := 0;
    
    // Work only with variables to eliminate Object access
    MemoryPtr := Memory.Memory;
    Position := Memory.Position;
    Size := Memory.Size;
    PatternLen := Length(APattern);

    // No calculation of end condition
    MaxPosition := Size - PatternLen + 1;

    while Position < MaxPosition do
    begin
      Offset := Position;
      Buffer := Byte(Pointer(Longint(MemoryPtr) + Offset)^);

      // ????? :(
    end;
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz