Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TDynDwordArray = array of DWORD;
- TDynTwoDimensionalDwordArray = array of TDynDwordArray;
- TDwMsStream = class(TMemoryStream)
- public
- procedure WriteTwoDimensionalDwordArray(const Data: TDynTwoDimensionalDwordArray);
- procedure ReadTwoDimensionalDwordArray(out Data: TDynTwoDimensionalDwordArray);
- end;
- { TDwMsStream }
- procedure TDwMsStream.ReadTwoDimensionalDwordArray(
- out Data: TDynTwoDimensionalDwordArray);
- var
- i: integer;
- tmp: Cardinal;
- begin
- ReadBuffer(tmp, sizeof(Cardinal));
- SetLength(Data, tmp);
- for i := 0 to length(Data) do
- begin
- ReadBuffer(tmp, sizeof(Cardinal));
- SetLength(Data[i], tmp);
- if tmp > 0 then
- ReadBuffer(Data[i], tmp * sizeof(DWORD));
- end;
- end;
- procedure TDwMsStream.WriteTwoDimensionalDwordArray(
- const Data: TDynTwoDimensionalDwordArray);
- var
- i: integer;
- tmp: Cardinal;
- begin
- tmp := Length(Data);
- WriteBuffer(tmp, sizeof(Cardinal));
- for i := 0 to length(Data) do
- begin
- tmp := Length(Data[i]);
- WriteBuffer(tmp, sizeof(Cardinal));
- if tmp > 0 then
- WriteBuffer(Data[i], tmp * sizeof(DWORD));
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement