cdegroot/underground — comment on commit c62ee909335e6e6ca2c23ddd5a4c435dd7461efe
File: main/src/main/scala/com/evrl/underground/Marshaller.scala line 12
By erikvanoosten:

I am wondering, it could be that its faster to create a new array each time int is called.

The fastest way (probably) is writing directly to the stream, like java.io.DataOutputStream#writeInt(int) would do. That is assuming the stream is properly buffered, with a buffer that corresponds (in size and alignment) with the disk blocks.