我有两个从中获取数据的流。我想输出一个按两个当前流的索引排序的流。为简单起见,这里是示例代码:
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);
}
我们没有关于索引传入的信息,它就像数据流的连续排序,即序列化。