0

I have an byte array that contains the file data. For Khichidi-1 (224-bits), the byte array is divided into N 224-bit blocks, M(1), M(2) ,..., M(N) is there any inbuilt class in java to perform this operation. If there is none like that, then how can we create N no.of variables depending on the no.of message blocks

5
  • What do you mean by Khichidi-1? _ is there any inbuilt class in java to perform this operation_: What Operation? Commented Jun 21, 2011 at 5:34
  • If you want to create variables like M(1), M(2) ,..., M(N) then use array of M. ie <Type> M[] = new <Type>[N]; Commented Jun 21, 2011 at 5:36
  • khichidi is the name of the algorithm we are implementing. Operation means storing the N values in the byte array to N different variables Commented Jun 21, 2011 at 5:36
  • Is there any method to solve this. Can anyone provide a solution please help me Commented Jun 21, 2011 at 5:55
  • That is what arrays are for. Find what the size you need, and create an array of the size needed. See Collections also. Commented Jun 21, 2011 at 6:13

1 Answer 1

1

To create classes at runtime with Java you would have to use its reflection capabilities, see: http://download.oracle.com/javase/tutorial/reflect/index.html

However, I don't think that would help you in this case as the data you describe is simple raw bits of a particular length. You could divvy the data up into 28-byte chunks in an array of byte arrays.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.