Changeset 303 for CoolStreaming
- Timestamp:
- Dec 5, 2011, 2:21:38 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolStreaming/UVarBlockSerializer.pas
r262 r303 58 58 constructor Create; 59 59 destructor Destroy; override; 60 procedure Assign(Source: TVarBlockSerializer); 60 61 property Stream: TStream read FStream write SetStream; 61 62 end; … … 100 101 constructor Create; 101 102 destructor Destroy; override; 103 procedure Assign(Source: TVarBlockIndexed); 102 104 end; 103 105 … … 582 584 end; 583 585 586 procedure TVarBlockSerializer.Assign(Source: TVarBlockSerializer); 587 var 588 Helper: TStreamHelper; 589 LastPos: Integer; 590 begin 591 OwnsStream := Source.OwnsStream; 592 FStream.Size := 0; 593 try 594 Helper := TStreamHelper.Create(Source.FStream); 595 LastPos := Source.FStream.Position; 596 Source.FStream.Position := 0; 597 Helper.ReadStream(FStream, Source.FStream.Size); 598 Source.FStream.Position := LastPos; 599 finally 600 Helper.Free; 601 end; 602 FStream.Position := Source.FStream.Position; 603 end; 604 584 605 { TVarBlockIndexed } 585 606 … … 777 798 if (Index >= 0) and (Index < Items.Count) then 778 799 Result := Assigned(Items[Index]) 779 else Result := False 800 else Result := False; 780 801 end; 781 802 … … 864 885 end; 865 886 887 procedure TVarBlockIndexed.Assign(Source: TVarBlockIndexed); 888 var 889 I: Integer; 890 begin 891 Enclose := Source.Enclose; 892 Items.Count := Source.Items.Count; 893 for I := 0 to Items.Count - 1 do begin 894 CheckItem(I); 895 TVarBlockSerializer(Items[I]).Assign(TVarBlockSerializer(Source.Items[I])); 896 end; 897 end; 898 866 899 end.
Note:
See TracChangeset
for help on using the changeset viewer.