@JRubyMethod public IRubyObject unused() { byte[] tmp = io.getAvailIn(); if (tmp == null) return getRuntime().getNil(); return RubyString.newString(getRuntime(), tmp); }
@JRubyMethod public IRubyObject unused() { byte[] tmp = io.getAvailIn(); if (tmp == null) return getRuntime().getNil(); return RubyString.newString(getRuntime(), tmp); }
@JRubyMethod public IRubyObject unused() { byte[] tmp = io.getAvailIn(); if (tmp == null) return getRuntime().getNil(); return RubyString.newString(getRuntime(), tmp); }
@JRubyMethod public IRubyObject unused() { byte[] tmp = io.getAvailIn(); if (tmp == null) return getRuntime().getNil(); return RubyString.newString(getRuntime(), tmp); }
public IRubyObject initialize(ThreadContext context, IRubyObject stream) { Ruby runtime = context.runtime; realIo = stream; try { // don't close realIO ioInputStream = new IOInputStream(realIo); io = new GZIPInputStream(ioInputStream, 512, false); // JRUBY-4502 // CRuby expects to parse gzip header in 'new'. io.readHeader(); } catch (IOException e) { RaiseException re = RubyZlib.newGzipFileError(runtime, "not in gzip format"); byte[] input = io.getAvailIn(); if (input != null && input.length > 0) { RubyException rubye = re.getException(); rubye.setInstanceVariable("@input", RubyString.newString(runtime, new ByteList(input, 0, input.length))); } throw re; } position = 0; line = 0; bufferedStream = new PushbackInputStream(new BufferedInputStream(io), 512); return this; }
public IRubyObject initialize(ThreadContext context, IRubyObject stream) { Ruby runtime = context.runtime; realIo = stream; try { // don't close realIO ioInputStream = new IOInputStream(realIo); io = new GZIPInputStream(ioInputStream, 512, false); // JRUBY-4502 // CRuby expects to parse gzip header in 'new'. io.readHeader(); } catch (IOException e) { RaiseException re = RubyZlib.newGzipFileError(runtime, "not in gzip format"); byte[] input = io.getAvailIn(); if (input != null && input.length > 0) { RubyException rubye = re.getException(); rubye.setInstanceVariable("@input", RubyString.newString(runtime, new ByteList(input, 0, input.length))); } throw re; } position = 0; line = 0; bufferedStream = new PushbackInputStream(new BufferedInputStream(io), 512); return this; }
@JRubyMethod(name = "initialize", visibility = PRIVATE, compat = RUBY1_8) public IRubyObject initialize(ThreadContext context, IRubyObject stream) { Ruby runtime = context.runtime; realIo = stream; try { // don't close realIO ioInputStream = new IOInputStream(realIo); io = new GZIPInputStream(ioInputStream, 512, false); // JRUBY-4502 // CRuby expects to parse gzip header in 'new'. io.readHeader(); } catch (IOException e) { RaiseException re = RubyZlib.newGzipFileError(runtime, "not in gzip format"); if (getRuntime().is1_9()) { byte[] input = io.getAvailIn(); if (input != null && input.length > 0) { RubyException rubye = re.getException(); rubye.setInstanceVariable("@input", RubyString.newString(runtime, new ByteList(input, 0, input.length))); } } throw re; } position = 0; line = 0; bufferedStream = new BufferedInputStream(io); return this; }
@JRubyMethod(name = "initialize", visibility = PRIVATE, compat = RUBY1_8) public IRubyObject initialize(ThreadContext context, IRubyObject stream) { Ruby runtime = context.runtime; realIo = stream; try { // don't close realIO ioInputStream = new IOInputStream(realIo); io = new GZIPInputStream(ioInputStream, 512, false); // JRUBY-4502 // CRuby expects to parse gzip header in 'new'. io.readHeader(); } catch (IOException e) { RaiseException re = RubyZlib.newGzipFileError(runtime, "not in gzip format"); if (getRuntime().is1_9()) { byte[] input = io.getAvailIn(); if (input != null && input.length > 0) { RubyException rubye = re.getException(); rubye.setInstanceVariable("@input", RubyString.newString(runtime, new ByteList(input, 0, input.length))); } } throw re; } position = 0; line = 0; bufferedStream = new BufferedInputStream(io); return this; }