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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,64599bfe530783cd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 13:00:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc53.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Any examples of Byte Ordering Functions References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.124.41 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc53 1066334408 12.234.124.41 (Thu, 16 Oct 2003 20:00:08 GMT) NNTP-Posting-Date: Thu, 16 Oct 2003 20:00:08 GMT Organization: Comcast Online Date: Thu, 16 Oct 2003 20:00:08 GMT Xref: archiver1.google.com comp.lang.ada:1015 Date: 2003-10-16T20:00:08+00:00 List-Id: >build to.from arrays of Unsigned_32. > >You could write your own functions to do this - it is trivial, esp if you How about raising the abstraction level and using Streams. ie, don't read something as Unsigned_32, then byte swap (or not). Instead define a 'Read for objects of the type and two implementation of that 'Read, one just reading four bytes and the other reading four bytes and swapping.