Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Documentation/Online Help    [ Add a report in this area ]  
Report #:  96441   Status: Open
TStreamReader and TStreamWriter inadequately documented
Project:  Delphi Build #:  15.0.3953.35171
Version:    15.1 Submitted By:   Greg Chapman
Report Type:  Documentation problem Date Reported:  7/20/2011 4:37:51 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   285119
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
I'm using the Help Update 3 for Delphi XE. The documentation for TStreamReader and TStreamWriter does not make clear under what conditions the readers and writers take ownership of their underlying streams. From the examples, it appears that they always take ownership when initialized with a string (filename), but do not take ownership when initialized with a TStream unless OwnStream is called explicitly.

It is especially important to have this clear, since, if the above is indeed the behavior of readers and writers, it is somewhat different than that of the .NET StreamReader and StreamWriter. Those classes always close the underlying stream when they are disposed. Given the statements (in the help file) that TStreamReader and TStreamWriter are functionally equivalent to their .NET counterparts, one might reasonably suppose that they would always free their underlying stream.
Steps to Reproduce:


Server Response from: ETNACODE01