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-Thread: 103376,127b4bdd944554a9,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Separate type for byte arrays Date: Thu, 04 May 2006 15:35:39 +0200 Message-ID: <87irolhpzo.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1146749741 16107 212.9.189.177 (4 May 2006 13:35:41 GMT) X-Complaints-To: Cancel-Lock: sha1:+8TXRycUmj1kcMblA7C1imGrDbU= Xref: g2news2.google.com comp.lang.ada:4061 Date: 2006-05-04T15:35:39+02:00 List-Id: Does it make sense to provide low-level I/O interfaces in terms of octet arrays as well as in terms of strings? In other words, procedure Read (Ch : in out Input_Channel; Item : out Byte_Array; Length: out Byte_Count); in addition to procedure Read (Ch : in out Input_Channel; Item : out String; Length: out Natural); ? This is a bit cumbersome. Unfortunately, it's not possible to make Read itself generic because it's a dispatching subprogram. If you parameterize the whole I/O subsystem on the element and array type, you still have the problem that no efficient communication is possible between two subsystems which store data in different array types (without using Unchecked_Conversion). The other alternative is to create some kind of buffer object which can be accessed as octet and character array. I've implemented this, and it doesn't look quite right, either. Any suggestions? I'm aiming for something similar java.nio.*. I'm not interested in machines which use strange character sets such as EBCDIC, or machines whose storage unit or stream element size is not 8 bit.