Encoder now uses JavaBinaryWriter