code: static void int2bin(
  	 int value,             /* input : decimal value */
  	 int no_of_bits,        /* input : number of bits to use */
  	 short[] bitstream, int bitstreams       /* output: bitstream  */
  	)
  	{
  	   int pt_bitstream;
  	   short   i, bit;
  
  	   pt_bitstream = bitstreams + no_of_bits;
  
  	   for (i = 0; i < no_of_bits; i++)
  	   {
  	     bit = (short)(value & 0x0001);      /* get lsb */
  	     if (bit == 0)
  	         bitstream[--pt_bitstream] = LD8KConstants.BIT_0;
  	     else
  	         bitstream[--pt_bitstream] = LD8KConstants.BIT_1;
  	     value >>= 1;
  	   }
  	}
docs: /*----------------------------------------------------------------------------
  int2bin convert integer to binary and write the bits bitstream array
  ----------------------------------------------------------------------------