ported java encode/decode to openjpeg 2.0