I want to store the byte array values I am getting, each time I iterate through the for loop. could you please tell me how can i store the byte array into an another array and after storing going to the next iteration in the for loop to get the another.
for(int i = 0;i<doc.getPageCount();i++){ CMBPage page = doc.getPages(0); int a = doc.getPageCount(); b[i] = baos.toByteArray();// 1 } Is statement 1 is right. If not how to update it. please help me.
1. You arbitrarily create b with a length of 5 but then loop with a upper bound of doc.getPageCount(). 2. I have not idea what doc or CMBPage are, but why do you only access page 0, not page i? 3. Why do you define a? 4. Where is baos defined? you call toByteArray repeatedly. Does the other code in the loop have some side effect on what toByteArray returns?