- Timestamp:
- Nov 19, 2012, 12:31:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas
r12 r24 31 31 procedure WriteByte(Data: Byte); 32 32 procedure WriteWord(Data: Word); 33 procedure WriteInteger(Data: Integer); 33 34 procedure WriteCardinal(Data: Cardinal); 34 35 procedure WriteInt64(Data: Int64); … … 44 45 function ReadByte: Byte; 45 46 function ReadWord: Word; 47 function ReadInteger: Integer; 46 48 function ReadCardinal: Cardinal; 47 49 function ReadInt64: Int64; … … 169 171 Buffer: array of Byte; 170 172 begin 171 if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size 173 //if Count > (List.Count - StartIndex) then 174 // Count := (List.Count - StartIndex); // Limit max. stream size 175 List.Count := Count; 172 176 if Count > 0 then begin 173 177 SetLength(Buffer, Count); … … 242 246 Result := 0; 243 247 Read(Result, SizeOf(Word)); 248 if SwapData then Result := SwapEndian(Result); 249 end; 250 251 function TBinarySerializer.ReadInteger: Integer; 252 begin 253 Result := 0; 254 Read(Result, SizeOf(Integer)); 244 255 if SwapData then Result := SwapEndian(Result); 245 256 end; … … 376 387 end; 377 388 389 procedure TBinarySerializer.WriteInteger(Data: Integer); 390 begin 391 if SwapData then Data := SwapEndian(Data); 392 Write(Data, SizeOf(Integer)); 393 end; 394 378 395 end. 379 396
Note:
See TracChangeset
for help on using the changeset viewer.