Examples of IOOutputStream


Examples of org.jruby.util.IOOutputStream

    }

    private static OutputStream outputStream(ThreadContext context, IRubyObject out) {
        setBinmodeIfPossible(context, out);
        return new IOOutputStream(out);
    }
View Full Code Here

Examples of org.jruby.util.IOOutputStream

        }

        @JRubyMethod(name = "to_outputstream")
        public static IRubyObject any_to_outputstream(ThreadContext context, IRubyObject self) {
            // using IOOutputStream may not be the most performance way, but it's easy.
            return JavaUtil.convertJavaToUsableRubyObject(context.runtime, new IOOutputStream(self));
        }
View Full Code Here

Examples of org.jruby.util.IOOutputStream

        if (emitter != null) throw context.runtime.newRuntimeError("already initialized emitter");

        Encoding encoding = PsychLibrary.YAMLEncoding.values()[(int)_encoding.convertToInteger().getLongValue()].encoding;
        Charset charset = context.runtime.getEncodingService().charsetForEncoding(encoding);

        emitter = new Emitter(new OutputStreamWriter(new IOOutputStream(io, encoding), charset), options);
    }
View Full Code Here

Examples of org.jruby.util.IOOutputStream

    private IRubyObject initializeCommon(IRubyObject stream, int level) {
        realIo = (RubyObject) stream;
        try {
            // the 15+16 here is copied from a Deflater default constructor
            Deflater deflater = new Deflater(level, 15+16, false);
            io = new GZIPOutputStream(new IOOutputStream(realIo, false, false), deflater, 512, false);
            return this;
        } catch (IOException ioe) {
            throw getRuntime().newIOErrorFromException(ioe);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.