Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
33
Task/Bitwise-IO/Ada/bitwise-io-3.ada
Normal file
33
Task/Bitwise-IO/Ada/bitwise-io-3.ada
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
|
||||
with Bit_Streams; use Bit_Streams;
|
||||
|
||||
procedure Test_Bit_Streams is
|
||||
File : File_Type;
|
||||
ABACUS : Bit_Array :=
|
||||
( 1,0,0,0,0,0,1, -- A, big endian
|
||||
1,0,0,0,0,1,0, -- B
|
||||
1,0,0,0,0,0,1, -- A
|
||||
1,0,0,0,0,1,1, -- C
|
||||
1,0,1,0,1,0,1, -- U
|
||||
1,0,1,0,0,1,1 -- S
|
||||
);
|
||||
Data : Bit_Array (ABACUS'Range);
|
||||
begin
|
||||
Create (File, Out_File, "abacus.dat");
|
||||
declare
|
||||
Bits : Bit_Stream (Stream (File));
|
||||
begin
|
||||
Write (Bits, ABACUS);
|
||||
end;
|
||||
Close (File);
|
||||
Open (File, In_File, "abacus.dat");
|
||||
declare
|
||||
Bits : Bit_Stream (Stream (File));
|
||||
begin
|
||||
Read (Bits, Data);
|
||||
end;
|
||||
Close (File);
|
||||
if Data /= ABACUS then
|
||||
raise Data_Error;
|
||||
end if;
|
||||
end Test_Bit_Streams;
|
||||
Loading…
Add table
Add a link
Reference in a new issue