title: Parsing byte array that contains different data types and able to get each value correctly using Java
body: <p>I am new to Java, working on byte arrays.</p>
  
  <p>I am having a Blob which is created in Database, which contains a double and float value. Now I have to read that into a byte array and should able to get the float and double separately.</p>
  
  <p>I am read the blob information into the byte array like so:</p>
  
  <pre><code>FileInputStream fin = new FileInputStream(file);
  
  byte[] fileContent = new byte[(int)file.length()];
  
  fin.read(fileContent);
  </code></pre>
  
  <p>and reading the byte array like</p>
  
  <pre><code>for(int i = 0; i &lt; fileContent.length; i++)
  
  {
  
    System.out.println("bit " + i + "= " + fileContent[i]);
  
    }
  </code></pre>
  
  <p>This is giving byte </p>
  
  <pre><code>   bit 0= -57
     bit 1= -16
     bit 2= -90
     bit 3= -109
     bit 4= 66
     bit 5= -90
     bit 6= 116
     bit 7= -25
     bit 8= -100
  </code></pre>