From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: In memory Stream Date: Sat, 17 Feb 2024 19:52:00 +0100 Organization: Adalog Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 17 Feb 2024 18:51:58 -0000 (UTC) Injection-Info: dont-email.me; posting-host="011f74747eef3fec73389fcfe6389fda"; logging-data="584944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QiXLVpJxZ5Vp6cJ43m8m7" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:i6xJ6zyD8WCb5qbxNHAjVWg+sgA= Content-Language: en-US, fr In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:66080 List-Id: Le 17/02/2024 à 15:42, DrPi a écrit : > Le 17/02/2024 à 15:26, J-P. Rosen a écrit : >> Le 17/02/2024 à 14:36, DrPi a écrit : >> > The library Jean-Pierre pointed me to perfectly matches this usage. Light and easy to use. Thanks. >> 🙂 >> >> > One enhancement I see is to manage the buffer size to avoid buffer overflow (or did I missed something ?). >> >> I don't see what you mean here... On the memory side, we are reading/writing bytes from memory, there is no notion of overflow. And the number of bytes processed by Read/Write is given by the size of Item, so no overflow either... >> > A memory buffer IS limited in size. It is either a peripheral buffer or a memory buffer you create yourself (my case). In either case, its size is limited. When writing in the stream, you have to care to not overflow the buffer. The purpose of this stream is to access raw memory, so there is no notion of "buffer size". It is up to you to match your (user) buffer with the memory buffer. Of course, you can add a layer with all the checks you want... [PS] I tried to respond to your email, but it bounced... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX https://www.adalog.fr https://www.adacontrol.fr