【发布时间】:2010-09-06 10:54:33
【问题描述】:
我在内存中有一个字节数组,从文件中读取。我想在某个点(索引)拆分字节数组,而不必只创建一个新的字节数组并一次复制每个字节,从而增加操作的内存占用量。我想要的是这样的:
byte[] largeBytes = [1,2,3,4,5,6,7,8,9];
byte[] smallPortion;
smallPortion = split(largeBytes, 3);
smallPortion 等于 1,2,3,4largeBytes 等于 5,6,7,8,9
【问题讨论】: