I have two streams from where I am getting the data. I would like to output a stream sorted by indexes of two current stream. for simplicity here is sample code:
While (1)
{
read.stream1(buffer1,size);
read.stream2(buffer2,size);
int index1 = (int) buffer1[20];
int index2 = (int) buffer2[20];
///// This is the part which I have to do:
sort based on the index, which ever index is small
send that.
outputbuffer = Sort(index1,buffer1,index2,buffer2);
/////
outputstream.send(outputbuffer);
}
we have no information about the incomings of indexes, its like continuous sorting of data stream i.e serialization.