From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ea59bb198e88f9f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: GNAT Ada.Streams Bug? Date: Sat, 27 Nov 2004 08:34:39 +0100 Organization: None Message-ID: <1119161.vGaeJs5laP@linux1.krischik.com> References: Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1101544321 03 16940 wZK3XmNviUvufSB 041127 08:32:01 X-Complaints-To: usenet-abuse@t-online.de X-ID: ZZ-8+BZEYe8oy1HAUbyrhg3IFlMNCdCC6ft389QdKFNiRFcAadxxgm User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6540 Date: 2004-11-27T08:34:39+01:00 List-Id: Warren W. Gay VE3WWG wrote: > Georg Bauhaus wrote: >> Warren W. Gay VE3WWG wrote: >> : The point about efficiency is also a good one to raise. For >> : example, if you String'Read(Stream,Var), GNAT calls the >> : 'Read routine for each and every Character of the string. >> : One pines for something more efficient than this, and I >> : hope for the day when this improves in GNAT. (hint) >> >> While not a stream of elements, perhaps Fast_Read in >> the XML/Ada sources is of interest? > > All kinds of possibilities are available when _you_ control > the format. But when dealing with things like partition > tables, and existing file formats, I find it disappointing > that Ada95 struggles with this. I am happy to see that this > problem is recognized, and will in some way be addressed in > the Ada200Y standard. True. When you do low level programming than you migh want to consider some of Ada's low level features - and not a very high level IO package. In your case: Read the data into an array of Short_Short_Integer and then use either Unchecked_Convertion or for X'Address use Y'Address to convert it to your structure. You should consider one of the lower level IO package to read the data. Ada has 4 IO packages and the most difficult part about them is to choose the right one. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com