{
  "authors": [
    "Miko Elbrecht"
  ],
  "description": "Provides a Root_Stream_Type wrapper over an array of octets in memory.",
  "licenses": "Apache-2.0 WITH LLVM-exception",
  "long-description": "`octet_memory_stream` provides a standalone `Ada.Streams.Root_Stream_Type`\nwrapper around an `Octet_Array` (array of 8-bit bytes,) primarily for the\npurpose of protecting an over-arching stream from misalignment while reading\nfrom, or writing to, e.g., a file format.\n\nIf the `Memory_Stream` detects an out-of-bounds error as the result of a read\nor write operation, an `Out_Of_Bounds_Error` exception will be raised.\n\n**NOTE:** This crate does not currently support writing from a `Memory_Stream`,\nhowever this is a priority and will be done so in update 1.1.0.\n\nExample Use\n-----------\nAll pertinent types and subprograms are available within the package \n`Octet_Memory_Stream`. Wrapping an `Octet_Array` is done through the\n`To_Stream` function.\n```ada\npragma Ada_2022;\n\nwith Ada.Text_IO;\nwith Ada.Streams.Stream_IO;\nuse  Ada.Streams.Stream_IO;\nwith Octet_Memory_Stream;\n\nprocedure TestDemo is\n   F                : File_Type;\n   Protected_Stream : Stream_Access;\n   Memory_Stream    : Octet_Memory_Stream.Stream_Access;\nbegin\n   Open (F, In_File, \"example\");\n   Protected_Stream := Stream (F);\n   declare\n      Data : Octet_Memory_Stream.Octet_Array (1 .. 50);\n   begin\n      Octet_Memory_Stream.Octet_Array'Read (Protected_Stream, Data);\n      Memory_Stream := Octet_Memory_Stream.To_Stream (Data);\n   end;\n   declare\n      OK_Data  : Octet_Memory_Stream.Octet_Array (1 .. 25);\n      OOB_Data : Octet_Memory_Stream.Octet_Array (1 .. 26);\n   begin\n      Octet_Memory_Stream.Octet_Array'Read (Memory_Stream, OK_Data);\n      Ada.Text_IO.Put_Line (OK_Data'Image);\n\n      Octet_Memory_Stream.Octet_Array'Read (Memory_Stream, OOB_Data);\n      --  exception raised above\n      Ada.Text_IO.Put_Line (OOB_Data'Image);\n   end;\n   Close (F);\nend TestDemo;\n```\n",
  "maintainers": [
    "Miko Elbrecht <pmt.mailservice@gmail.com>"
  ],
  "maintainers-logins": [
    "ATPStorages"
  ],
  "name": "octet_memory_stream",
  "origin": {
    "commit": "73fcfb370f5763630e8ccb72457d43018daa01d9",
    "url": "git+https://github.com/Bread-Experts-Group/octet_memory_stream.git"
  },
  "tags": [
    "octet",
    "byte",
    "buffer",
    "stream",
    "ada",
    "streams",
    "memory"
  ],
  "version": "1.0.0",
  "website": "https://github.com/Bread-Experts-Group/octet_memory_stream"
}
