Changeset 262 for CoolStreaming
- Timestamp:
- Aug 15, 2011, 11:57:32 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolStreaming/UVarBlockSerializer.pas
r247 r262 39 39 procedure ReadVarStream(AStream: TStream); 40 40 function GetVarSize: Integer; 41 function GetVarCount: Integer; 41 42 42 43 // Advanced data types … … 423 424 end; 424 425 426 function TVarBlockSerializer.GetVarCount: Integer; 427 var 428 Data: Byte; 429 StoredPosition: Integer; 430 Skip: Integer; 431 begin 432 StoredPosition := Stream.Position; 433 Result := 0; 434 while Stream.Position < Stream.Size do begin 435 Data := Stream.ReadByte; 436 if Data = $ff then Skip := ReadVarUInt 437 else Skip := DecodeUnaryLength(Data) - 1; 438 Stream.Seek(Skip, soCurrent); 439 Inc(Result); 440 end; 441 Stream.Position := StoredPosition; 442 end; 443 425 444 procedure TVarBlockSerializer.WriteVarSInt(Value: Int64); 426 445 begin
Note:
See TracChangeset
for help on using the changeset viewer.