public RaiseException newLoadError(String message, String path) { RaiseException loadError = newRaiseException(getLoadError(), message); loadError.getException().setInstanceVariable("@path", newString(path)); return loadError; }
public RaiseException newLoadError(String message, String path) { RaiseException loadError = newRaiseException(getLoadError(), message); loadError.getException().setInstanceVariable("@path", newString(path)); return loadError; }
public RaiseException newLoadError(String message, String path) { RaiseException loadError = newRaiseException(getLoadError(), message); if (is2_0()) loadError.getException().setInstanceVariable("@path", newString(path)); return loadError; }
public RaiseException newLoadError(String message, String path) { RaiseException loadError = newRaiseException(getLoadError(), message); if (is2_0()) loadError.getException().setInstanceVariable("@path", newString(path)); return loadError; }
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; }
static RaiseException newGzipFileError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass("GzipFile").getClass(klass); RubyException excn = RubyException.newException(runtime, errorClass, message); // TODO: not yet supported. rewrite GzipReader/Writer with Inflate/Deflate? excn.setInstanceVariable("@input", runtime.getNil()); return excn.toThrowable(); }
static RaiseException newGzipFileError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass("GzipFile").getClass(klass); RubyException excn = RubyException.newException(runtime, errorClass, message); // TODO: not yet supported. rewrite GzipReader/Writer with Inflate/Deflate? excn.setInstanceVariable("@input", runtime.getNil()); return excn.toThrowable(); }
static RaiseException newGzipFileError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass("GzipFile").getClass(klass); RubyException excn = RubyException.newException(runtime, errorClass, message); if (runtime.is1_9()) { // TODO: not yet supported. rewrite GzipReader/Writer with Inflate/Deflate? excn.setInstanceVariable("@input", runtime.getNil()); } return new RaiseException(excn, true); }
static RaiseException newGzipFileError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass("GzipFile").getClass(klass); RubyException excn = RubyException.newException(runtime, errorClass, message); if (runtime.is1_9()) { // TODO: not yet supported. rewrite GzipReader/Writer with Inflate/Deflate? excn.setInstanceVariable("@input", runtime.getNil()); } return new RaiseException(excn, true); }
@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; }