BinaryIO.edp 685 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
load "BinaryIO"
// test of BinaryIO tools ...

real[int] buffer1(5);
real[int] buffer2(5);

for (int ii=0;ii<5;ii++)
  buffer1[ii]=ii;

SaveVec(buffer1,"saveBuff");
int size=0;
GetSizeVec(size,"saveBuff");
cout<<"size ="<<size<<endl;

LoadVec(buffer2,"saveBuff");
for (int ii=0;ii<size;ii++)
  cout<<buffer2[ii]<<" ";
cout<<endl;

for (int jj=0;jj<4;jj++){
  for (int ii=0;ii<5;ii++)
    buffer1[ii]=buffer1[ii]+5;
  SaveVecAppend(buffer1,"saveBuff");
}
int newSize=25;


SetSizeVec(newSize,"saveBuff");
GetSizeVec(size,"saveBuff");
real[int] buffer3(size);
cout<<"now size ="<<size<<endl;
LoadVec(buffer3,"saveBuff");
for (int ii=0;ii<size;ii++)
  cout<<buffer3[ii]<<" ";
cout<<endl;