breaking float value in char and transmit it on tcp and read using java program : <p>I using this c code to convert and transmit float data form micro controller using TCP/IP. Here I break float in to four char value and this work well. But I need its equivalent java code to again get float value on server end. </p>

<p>I am new for java. so please help.  </p>

<p>/********************************************************************************/</p>

<pre><code>unsigned char outbox[5];

void breakDown(void)
{
  int index=0;
  float member=-600.231;    

  unsigned long d = *(unsigned long *)&amp;member;
  outbox[0] = d &amp; 0x00FF;
  outbox[1] = (d &amp; 0xFF00) &gt;&gt; 8;
  outbox[2] = (d &amp; 0xFF0000) &gt;&gt; 16;
  outbox[3] = (d &amp; 0xFF000000) &gt;&gt; 24;

  }


  void buildUp(void) 
  {
   unsigned long d;
   unsigned index;

   d =  ((long)outbox[3] &lt;&lt; 24);
   d|=  ((long)outbox[2] &lt;&lt; 16);
   d|=  ((long)outbox[1] &lt;&lt; 8);
   d|=  ((long)outbox[0]);

   float member = *(float *)&amp;d;
   printf("Float output=%f\n\n",member);

   }
</code></pre>
