Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
RTL
Delphi
Arithmetic
ConvUtils
Date - Time
DateUtils
File Management
Format + Float
Input/Output
Math Unit
Memory, Pointer, Address
Null-terminated strings
Other Classes
Other RTL
Pascal Strings
Regular Expressions
RTL Exceptions
Text Files
Thread support
Typed/Untyped Files
WinAPI
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/RTL/Delphi/File Management
[ Add a report in this area ]
Report #:
65522
Status:
Closed
TMemoryStream.LoadFromFile throws "Stream read error"
Project:
Delphi
Build #:
11.0.2902.10471
Version:
11.2
Submitted By:
Yahoo Serious
Report Type:
Basic functionality failure
Date Reported:
8/11/2008 6:12:22 AM
Severity:
Extreme corner case
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
263933
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
15.0.3577.25507
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
I encountered a "Stream read error" using TMemoryStream.LoadFromFile. It was non-deterministic (sometimes it was thrown, sometimes it wasn't.)
Some searching led me to a newsgroup-message:
borland.public.delphi.vcl.components.using.win32
Re: Help! Stream-Read-Error on TMemoryStream.LoadFromFile
Remy Lebeau (TeamB) [Jun 3 2004, 19:34]
Where Gambit explains:
"if it [TMemoryStream] doesn't read the full data in one try, it throws an exception."
I think this asks for a better error description than "Stream read error", e.g. mentioning the file and/or the file size.
Besides, I think this would call for better handling, e.g. using TMemoryStream.CopyFrom like Gambit suggests.
Steps to Reproduce:
Use TMemoryStream.LoadFromFile with a large file (mine is appr. 94 MB)
Workarounds
Use TFileStream.LoadFromFile and TMemoryStream.CopyFrom(TFileStream) like Gambit suggests?
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us