TCSVBuilder.DefaultOutputAsString always raises EReadError
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
TCSVBuilder.DefaultOutputAsString always raises EReadError because the GetDefaultOutputAsString method reads past the stream end.
Basically, someone has forgot to reset the stream position to 0 before reading the entire stream.
Additional information:
See here for the reference:
function TCSVBuilder.GetDefaultOutputAsString: String;
var
StreamSize: Integer;
begin
Result := '';
StreamSize := FDefaultOutput.Size;
if StreamSize > 0 then
begin
SetLength(Result, StreamSize);
FDefaultOutput.ReadBuffer(Result[1], StreamSize);
end;
end;
Mantis conversion info:
- Mantis ID: 35936
- Fixed in revision: 42936 (#dfb00e85)
- Monitored by: » dezlov (Denis Kozlov)