title: Java - overwrite portion of binary file
body: <p>I am trying to overwrite last 26 bytes of file. Basically i need to put a few integer and byte variables there. I'm trying to use a DataOutputStream together with FileOutputStream, but these things do not have a seek() method or something like it. So how could i do a writeInt() starting at (file size - 26)? I see there is a write method that accepts an offset but i'm not sure if it is what i want and if so, how to convert int, long and byte variables into byte[] to pass into that method.</p>
  
  <p>Thank you for your advice</p>