the test code is here:
#include "../JuceLibraryCode/JuceHeader.h"
#include <iostream>
int main()
{
using namespace std;
MemoryBlock block1;
block1.setSize(10 * 4,true);
int* p = (int*)block1.getData();
cout << "block1 is:" << endl;
for(int i = 0; i <10 ; ++i) {
p[i] = i+1;
cout << p[i]<<" ";
}
cout << endl;
BigInteger x;
x.loadFromMemoryBlock(block1);
MemoryBlock block2=x.toMemoryBlock();
int* p2 = (int*)block2.getData();
cout << "block2 is:" << endl;
for(int i = 0; i < 10;++i) {
cout << p2[i] << " ";
}
return 1;
}
I thought the output of block1 and block2 is same, but I get the result :
block1 is:
1 2 3 4 5 6 7 8 9 10
block2 is:
1 2 3 4 5 6 7 8 9 -33686262
so....why -33686262 here? I thought it would be "10".. THX