【发布时间】:2016-12-28 05:43:58
【问题描述】:
我创建的方法应该在数组索引
public static void addPacketsToTable(byte[] byteTable, long packetSize, long diskSpace) throws IOException {
long packet = fetchPacketSize();//size of packet (it is 5)
long space = fetchDiskSpace();//free space on my disk
for(int i = 0; i < byteTable.length; i++) {//for another packet
while(packet < space && byteTable[i] < 4) {
packet *= 2;
while(byteTable[i] > 4) {
packet *= 3;
}
System.out.println(packet);
}
}
}
【问题讨论】:
-
也许您可以提供更多上下文。我实际上不知道您的代码应该做什么;或者它应该用于什么......
-
这个想法是将数据包值 *2 从索引 0 乘以 4,然后将该值乘以 *3 直到空闲空间消失