4 Replies Latest reply: Dec 11, 2006 3:57 AM by 807607 RSS

    help, converting integers to array of bytes

    807607
      Hi, I have an array of integer as follows:

      int[] values = {1, 2, 6, 13, 17}

      byte 1 represent values 0 - 7
      byte 2 represent values 8 - 15
      etc..

      I want to convert the above integer array to an array of byte.
      I.e the array if byte represented in decimal should be like this

      byte[0] = 70
      byte[1] = 32
      byte[2] = 2

      Can anyone please show me how to achieve this
      thanks in advance