Added lots of stuff to write binary local header directly