I'm wondering if it is possible for me to add multiple byte[] of a file into an arraylist and later on write the btye[] inside back to a file.
Sorry for being vague, this is my first time posting below is a segment of my code. the output file seem to be bigger then the original file and i cant seem to figure out why
ArrayList<byte[]> tempStorage = new ArrayList<byte[]>();
byte[] byteArray;
while (n < length && n != -1)
{
byteArray = new byte[960];
n = in.read(byteArray, 0, 960);
tempStorage.add(byteArray);
count++;
}
for (byte[] temp: tempStorage) {
fileOuputStream.write(temp);
}
fileOuputStream.close();