< Ada Programming < Libraries
![](../../../I/Ada_Mascot_with_slogan.svg.png.webp)
Ada. Time-tested, safe and secure.
This language feature is available from Ada 95 on. Ada.Storage_IO is a unit of the Predefined Language Environment since Ada 95.
Description
Ada.Storage_IO is not a general-purpose Input/Output package. It is designed for concurrent programming, and can be used to transfer elements from one task to another.
It allows you to store one element inside a memory buffer. The element needs to be of a definite subtype.
Specification
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual -- -------------------------------------------------------------------------with
Ada.IO_Exceptions;with
System.Storage_Elements;generic
type
Element_Typeis
private
;package
Ada.Storage_IOis
pragma
Preelaborate (Storage_IO); Buffer_Size :constant
System.Storage_Elements.Storage_Count := implementation_defined;subtype
Buffer_Typeis
System.Storage_Elements.Storage_Array (1 .. Buffer_Size); -- Input and output operationsprocedure
Read (Buffer :in
Buffer_Type; Item :out
Element_Type);procedure
Write (Buffer :out
Buffer_Type; Item :in
Element_Type); -- Exceptions Data_Error :exception
renames
IO_Exceptions.Data_Error;end
Ada.Storage_IO;
See also
Wikibook
External examples
- Search for examples of
Ada.Storage_IO
in: Rosetta Code, GitHub or this Wikibook. - Search for any post related to
Ada.Storage_IO
in: Stack Overflow, comp.lang.ada or any Ada related page.
Ada Reference Manual
Ada 95
Ada 2005
Ada 2012
Open-Source Implementations
FSF GNAT
- Specification: a-storio.ads
- Body: a-storio.adb
drake
- Specification: streams/a-storio.ads
- Body: streams/a-storio.adb
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.