- Timestamp:
- Mar 6, 2016, 12:10:38 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas
r54 r72 65 65 StringLength: Longint; 66 66 begin 67 StringLength := 0; 67 68 FStream.ReadBuffer(StringLength, SizeOf(StringLength)); 68 69 Result := ReadString(StringLength); … … 94 95 function TBinarySerializer.ReadByte: Byte; 95 96 begin 97 Result := 0; 96 98 FStream.ReadBuffer(Result, SizeOf(Byte)); 97 99 end; … … 99 101 function TBinarySerializer.ReadCardinal: Cardinal; 100 102 begin 103 Result := 0; 101 104 FStream.ReadBuffer(Result, SizeOf(Cardinal)); 102 105 if SwapData then Result := SwapEndian(Result); … … 105 108 function TBinarySerializer.ReadInt64: Int64; 106 109 begin 110 Result := 0; 107 111 FStream.ReadBuffer(Result, SizeOf(Int64)); 108 112 if SwapData then Result := SwapEndian(Result); … … 121 125 Count: Byte; 122 126 begin 127 Count := 0; 123 128 FStream.ReadBuffer(Count, 1); 124 129 Result := ReadString(Count); … … 206 211 function TBinarySerializer.ReadDouble: Double; 207 212 begin 213 Result := 0; 208 214 FStream.ReadBuffer(Result, SizeOf(Double)); 209 215 end; … … 211 217 function TBinarySerializer.ReadSingle: Single; 212 218 begin 219 Result := 0; 213 220 FStream.ReadBuffer(Result, SizeOf(Single)); 214 221 end; … … 216 223 function TBinarySerializer.ReadWord: Word; 217 224 begin 225 Result := 0; 218 226 FStream.ReadBuffer(Result, SizeOf(Word)); 219 227 if SwapData then Result := SwapEndian(Result); … … 262 270 procedure TBinarySerializer.WriteByte(Data: Byte); 263 271 begin 272 Data := 0; 264 273 FStream.WriteBuffer(Data, SizeOf(Byte)); 265 274 end;
Note:
See TracChangeset
for help on using the changeset viewer.