title: (java) Writing in file little endian
body: <p>I'm trying to write TIFF IFDs, and I'm looking for a simple way to do the following (this code obviously is wrong but it gets the idea across of what I want):</p>
  
  <pre><code>out.writeChar(12) (bytes 0-1)
  out.writeChar(259) (bytes 2-3)
  out.writeChar(3) (bytes 4-5)
  out.writeInt(1) (bytes 6-9)
  out.writeInt(1) (bytes 10-13)
  </code></pre>
  
  <p>Would write:</p>
  
  <p>0c00 0301 0300 0100 0000 0100 0000</p>
  
  <p>I know how to get the writing method to take up the correct number of bytes (writeInt, writeChar, etc) but I don't know how to get it to write in little endian. Anyone know?</p>