aspose file tools*
The moose likes Beginning Java and the fly likes byte array of byte arrays. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "byte array of byte arrays." Watch "byte array of byte arrays." New topic
Author

byte array of byte arrays.

cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
Hi

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

Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

// This is an array of twenty ten-byte arrays.
byte[][] bytes = new byte[20][10];


[Jess in Action][AskingGoodQuestions]
cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
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

Joined: May 22, 2003
Posts: 657

The Java� Tutorial - Arrays of Arrays
cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
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

Joined: Sep 16, 2005
Posts: 1780
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?


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: byte array of byte arrays.