Buffer data is converted to string output

xiaoxiao2021-03-06  49

Recently, help friends use Delphi to make a AES addending process, need to display buffer data during the process. At first, considering converting the BYTE array into a string, and no suitable method is found. Later, there is a TStringStream when viewing the TSTREAM class, you can read data directly from the buffer and then convert to a string.

code show as below:

var TempIn, TempOut: TAESBuffer; StrStream: TStringStream; s: string; begin // Create Object strstream StrStream: = TStringStream.Create (s); try // restore the pointer to the string head StrStream.Seek (0, soFromBeginning); // Read the data from the buffer reading data strStream.write (Tempout, Sizeof (Tempout)); Finally Strstream.free; end;

转载请注明原文地址:https://www.9cbs.com/read-40683.html

New Post(0)