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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,641f47d4563311a6 X-Google-Attributes: gid103376,public From: "James S. Rogers" Subject: Re: Array of bytes type Date: 2000/05/19 Message-ID: <4kfV4.73431$fV.4551641@bgtnsc05-news.ops.worldnet.att.net>#1/1 X-Deja-AN: 625494830 References: <3924E094.6B03B5BD@concentric.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 958759296 12.74.129.236 (Fri, 19 May 2000 18:01:36 GMT) Organization: AT&T Worldnet NNTP-Posting-Date: Fri, 19 May 2000 18:01:36 GMT Newsgroups: comp.lang.ada Date: 2000-05-19T00:00:00+00:00 List-Id: Joseph P Vlietstra wrote in message <3924E094.6B03B5BD@concentric.net>... >2. Use Stream_Element_Array. > We do a lot of UC between our byte arrays and other data types. > (Commmands come in and telemetry goes out in byte arrays.) > This approach allows the possibility of using 'Read and 'Write > to perform conversions on the byte array (using memory stream). > The problem, of course, is that Stream_Element is implementation > defined and need not match Storage_Element. > BTW: Does anyone know of an implementation where Stream_Element > doesn't match Storage_Element? Ada a matter of fact, yes. Some implementations of streams will use the size of the base type as the stream element size, no matter what is specified for the 'Size attribute. My project found the only reliable work-around for that compiler was to convert all bytes to and from characters when using streams. >5. Any other ideas? One more possibility: type Byte is mod 2**8; type Byte_Array is array(Positive range <>) of Byte; Jim Rogers Colorado Springs, Colorado USA