Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

byte array of byte arrays.

 
cathymala louis
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

How to declare and access the byte array of byte arrays. Any tutorials really appreciated.

Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// This is an array of twenty ten-byte arrays.
byte[][] bytes = new byte[20][10];
 
cathymala louis
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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.

Thanks.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
 
cathymala louis
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

byte[][] b = new byte[5][];

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.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!