comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: GNAT Ada.Streams Bug?
Date: Sat, 27 Nov 2004 08:34:39 +0100
Date: 2004-11-27T08:34:39+01:00	[thread overview]
Message-ID: <1119161.vGaeJs5laP@linux1.krischik.com> (raw)
In-Reply-To: LKJpd.59640$Ro.2237800@news20.bellglobal.com

Warren W. Gay VE3WWG wrote:

> Georg Bauhaus wrote:
>> Warren W. Gay VE3WWG <ve3wwg@nospam.cogeco.ca> 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



  reply	other threads:[~2004-11-27  7:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-25 17:41 GNAT Ada.Streams Bug? Warren W. Gay VE3WWG
2004-11-25 19:40 ` Jeff C r e e.m
2004-11-26  4:11   ` Warren W. Gay VE3WWG
2004-11-26  9:49     ` Georg Bauhaus
2004-11-26 17:30       ` Warren W. Gay VE3WWG
2004-11-27  7:34         ` Martin Krischik [this message]
2004-11-28  1:10           ` Warren W. Gay VE3WWG
2004-11-29  7:50         ` tmoran
2004-11-29 17:47           ` Warren W. Gay VE3WWG
2004-11-26 22:47     ` Simon Wright
2004-11-27 14:42       ` Warren W. Gay VE3WWG
2004-11-27 17:25         ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox