Changeset 25
- Timestamp:
- May 14, 2010, 7:12:13 AM (15 years ago)
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MemoryStreamEx/UMemoryStreamEx.pas
r16 r25 60 60 StringLength: Longint; 61 61 begin 62 Read (StringLength, SizeOf(StringLength));62 ReadBuffer(StringLength, SizeOf(StringLength)); 63 63 SetLength(Result, StringLength); 64 64 if StringLength > 0 then begin 65 Read (Result[1], StringLength);65 ReadBuffer(Result[1], StringLength); 66 66 end; 67 67 end; … … 69 69 function TMemoryStreamEx.ReadByte: Byte; 70 70 begin 71 Read (Result, SizeOf(Byte));71 ReadBuffer(Result, SizeOf(Byte)); 72 72 end; 73 73 74 74 function TMemoryStreamEx.ReadCardinal: Cardinal; 75 75 begin 76 Read (Result, SizeOf(Cardinal));76 ReadBuffer(Result, SizeOf(Cardinal)); 77 77 if SwapData then Result := Swap(Result); 78 78 end; … … 80 80 function TMemoryStreamEx.ReadInt64: Int64; 81 81 begin 82 Read (Result, SizeOf(Int64));82 ReadBuffer(Result, SizeOf(Int64)); 83 83 if SwapData then Result := Swap(Result); 84 84 end; … … 88 88 Count: Byte; 89 89 begin 90 Read (Count, 1);90 ReadBuffer(Count, 1); 91 91 SetLength(Result, Count); 92 Read (Result[1], Count);92 ReadBuffer(Result[1], Count); 93 93 end; 94 94 … … 99 99 if Count > 0 then begin 100 100 SetLength(Buffer, Count); 101 Read (Buffer[0], Count);101 ReadBuffer(Buffer[0], Count); 102 102 Stream.Size := Count; 103 103 Stream.Position := 0; … … 118 118 function TMemoryStreamEx.ReadDouble: Double; 119 119 begin 120 Read (Result, SizeOf(Double));120 ReadBuffer(Result, SizeOf(Double)); 121 121 end; 122 122 123 123 function TMemoryStreamEx.ReadSingle: Single; 124 124 begin 125 Read (Result, SizeOf(Single));125 ReadBuffer(Result, SizeOf(Single)); 126 126 end; 127 127 128 128 function TMemoryStreamEx.ReadWord: Word; 129 129 begin 130 Read (Result, SizeOf(Word));130 ReadBuffer(Result, SizeOf(Word)); 131 131 if SwapData then Result := Swap(Result); 132 132 end;
Note:
See TracChangeset
for help on using the changeset viewer.