I\'m trying to write data to a file in binary format for compression. The data consists entirely of floating points so I decided to quantize the data to an intergers between
What about the DataOutputStream. You can write int which contains 2 of your data integers.
DataOutputStream dos = new DataOutputStream(new FileOutputStream());
ArrayList list = new ArrayList();
int sum;
for( int i = 0; i < list.size(); i++ ) {
if(i%2!=0){
sum |= list.get( i ).intValue()<<16;
dos.writeInt( sum );
} else {
sum = list.get( i ).intValue();
}
}