public static void transcodeLoop(ThreadContext context, ByteList fromp, ByteList dest, byte[] sname, byte[] dname, int ecflags, IRubyObject ecopts) { Transcoder ec; ec = econvOpenOpts(context, sname, dname, ecflags, ecopts); if (ec == null) { throw econvOpenExc(context, sname, dname, ecflags); } // TODO: fallback function RubyCoderResult result = ec.transcode(context, fromp, dest); }
public static void transcodeLoop(ThreadContext context, ByteList fromp, ByteList dest, byte[] sname, byte[] dname, int ecflags, IRubyObject ecopts) { Transcoder ec; ec = econvOpenOpts(context, sname, dname, ecflags, ecopts); if (ec == null) { throw econvOpenExc(context, sname, dname, ecflags); } // TODO: fallback function RubyCoderResult result = ec.transcode(context, fromp, dest); }
private void makeReadConversion(ThreadContext context) { if (readconv != null) return; int ecflags; IRubyObject ecopts; byte[] sname, dname; ecflags = this.ecflags & ~EncodingUtils.ECONV_NEWLINE_DECORATOR_WRITE_MASK; ecopts = this.ecopts; if (enc2 != null) { sname = enc2.getName(); dname = enc.getName(); } else { sname = dname = EMPTY_BYTE_ARRAY; } readconv = EncodingUtils.econvOpenOpts(context, sname, dname, ecflags, ecopts); if (readconv == null) { throw EncodingUtils.econvOpenExc(context, sname, dname, ecflags); } // rest of MRI code sets up read/write buffers }
private void makeReadConversion(ThreadContext context) { if (readconv != null) return; int ecflags; IRubyObject ecopts; byte[] sname, dname; ecflags = this.ecflags & ~EncodingUtils.ECONV_NEWLINE_DECORATOR_WRITE_MASK; ecopts = this.ecopts; if (enc2 != null) { sname = enc2.getName(); dname = enc.getName(); } else { sname = dname = EMPTY_BYTE_ARRAY; } readconv = EncodingUtils.econvOpenOpts(context, sname, dname, ecflags, ecopts); if (readconv == null) { throw EncodingUtils.econvOpenExc(context, sname, dname, ecflags); } // rest of MRI code sets up read/write buffers }
public void makeReadConversion(ThreadContext context, int size) { if (readconv == null) { int ecflags; IRubyObject ecopts; byte[] sname, dname; ecflags = encs.ecflags & ~EConvFlags.NEWLINE_DECORATOR_WRITE_MASK; ecopts = encs.ecopts; if (encs.enc2 != null) { sname = encs.enc2.getName(); dname = encs.enc.getName(); } else { sname = dname = EMPTY_BYTE_ARRAY; } readconv = EncodingUtils.econvOpenOpts(context, sname, dname, ecflags, ecopts); if (readconv == null) throw EncodingUtils.econvOpenExc(context, sname, dname, ecflags); cbuf.off = 0; cbuf.len = 0; if (size < IO_CBUF_CAPA_MIN) size = IO_CBUF_CAPA_MIN; cbuf.capa = size; cbuf.ptr = new byte[cbuf.capa]; } }
public void makeReadConversion(ThreadContext context, int size) { if (readconv == null) { int ecflags; IRubyObject ecopts; byte[] sname, dname; ecflags = encs.ecflags & ~EConvFlags.NEWLINE_DECORATOR_WRITE_MASK; ecopts = encs.ecopts; if (encs.enc2 != null) { sname = encs.enc2.getName(); dname = encs.enc.getName(); } else { sname = dname = EMPTY_BYTE_ARRAY; } readconv = EncodingUtils.econvOpenOpts(context, sname, dname, ecflags, ecopts); if (readconv == null) throw EncodingUtils.econvOpenExc(context, sname, dname, ecflags); cbuf.off = 0; cbuf.len = 0; if (size < IO_CBUF_CAPA_MIN) size = IO_CBUF_CAPA_MIN; cbuf.capa = size; cbuf.ptr = new byte[cbuf.capa]; } }
throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], 0); throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], ecflags_p[0]);
throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], 0); throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], ecflags_p[0]);
writeconv = EncodingUtils.econvOpenOpts(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags); writeconv = EncodingUtils.econvOpenOpts(context, senc, denc, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, senc, denc, ecflags);
writeconv = EncodingUtils.econvOpenOpts(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags); writeconv = EncodingUtils.econvOpenOpts(context, senc, denc, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, senc, denc, ecflags);
writeconv = EncodingUtils.econvOpenOpts(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags); writeconv = EncodingUtils.econvOpenOpts(context, senc, denc, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, senc, denc, ecflags);
writeconv = EncodingUtils.econvOpenOpts(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY, ecflags); writeconv = EncodingUtils.econvOpenOpts(context, senc, denc, ecflags, ecopts); if (writeconv == null) { throw EncodingUtils.econvOpenExc(context, senc, denc, ecflags);
throw econvOpenExc(context, sname, dname, ecflags);
throw econvOpenExc(context, sname, dname, ecflags);
throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], ecflags[0]);
throw EncodingUtils.econvOpenExc(context, encNames[0], encNames[1], ecflags[0]);