// NewEncoder returns a new encoder that will transmit on the io.Writer. public static ptr <Encoder> NewEncoder(io.Writer w) { ptr <Encoder> enc = @new <Encoder>(); enc.w = new slice <io.Writer>(new io.Writer[] { w }); enc.sent = make_map <reflect.Type, typeId>(); enc.countState = enc.newEncoderState(@new <encBuffer>()); return(_addr_enc !); }