title: Read in 4-byte words from binary file in Julia
body: <p>I have a simple binary file that contains 32-bit floats adjacent to each other.</p>
  
  <p>Using Julia, I would like to read each number (i.e. each 32-bit word) and put them each sequentially into a array of <code>Float32</code> format. </p>
  
  <p>I've tried a few different things through looking at <a href="http://julia.readthedocs.org/en/latest/stdlib/base/" rel="noreferrer">the documentation</a>, but all have yielded impossible values (I am using a binary file with known values as dummy input). It appears that:</p>
  
  <ol>
  <li><p>Julia is reading the binary file one-byte at a time.</p></li>
  <li><p>Julia is putting each byte into a <code>Uint8</code> array.</p></li>
  </ol>
  
  <p>For example, <code>readbytes(f, 4)</code> gives a 4-element array of unsigned 8-bit integers. <code>read(f, Float32, DIM)</code> also gives strange values.</p>
  
  <p>Anyone have any idea how I should proceed?</p>