流转Base64字符串
function StreamToBase64String(AStream: TStream): string;
var
B: TBytes;
vStream: TMemoryStream;
begin
vStream := TMemoryStream.Create;
try
AStream.position := 0;
ZCompressStream(AStream, vStream, zcMax);
SetLength(B, vStream.Size);
vStream.position := 0;
vStream.ReadBuffer(B, vStream.Size);
Result := TNetEncoding.Base64.EncodeBytesToString(B);
finally
vStream.DisposeOf;
end;
end;
无
《学习大师原创文档,请勿转载,侵权必究》