这是我的Main
方法中的代码的一部分。我想将一个特定数组的输出存储在一个新类中(你可以在代码的注释中看到它。
int splitNum = 0;
BufferedWriter out =
new BufferedWriter(new OutputStreamWriter(new FileOutputStream("data.txt"), "ISO-8859-1"));
ArrayList<Split> allSplits = new ArrayList<Split>();
int[]version=new int[(int) NUM_OF_SPLITS];
while((numRead = (reader.read(buf))) != -1){
String readData = String.valueOf(buf, 0, numRead);
version[splitNum]=1;
// I need to store the output of the array version in a new class
String encrypted = Encryptor.run(readData);
Split split = new Split(encrypted, splitNum);
System.out.println( "Split:" + split.blocks + "\n\n" );
WatchDog.run(split);
Permutator.run(split);
System.out.println( "Final Split:" + split.blocks + "\n\n");
allSplits.add(split);
buf = new char[StaticData.splitSize];
splitNum++;
}
这似乎是一些基本的东西,但我现在想不出来。有什么帮助吗?谢谢