implement Coder.getCodec() and fix const error in Codec class