On Jan 30, 3:42 pm, europe72 <[EMAIL PROTECTED]> wrote: > Hello, > > I understand that the proper way to create a Java byte array in Rhino > is by using the following code (which creates an empty byte array with > four indexes): > > var my_byte_array = new > Packages.java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 4); > > If I wanted to store the integer 1024 in the array what would be the > preferred method? > > I can do something like the following, but I assume there is something > similar to byte[1024] that I can use, which would be easier. > > buffer[0] = 4; > buffer[1] = 2; > buffer[2] = 0; > buffer[3] = 1;
I can't tell what you are trying to do. Are you trying to use a byte to store each decimal digit? Do you need to do this for some reason? -- David P. Caldwell http://www.inonit.com/ _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
