public UnmarshalStream(Ruby runtime, InputStream in, IRubyObject proc, boolean taint, boolean untrust) throws IOException { this.runtime = runtime; this.cache = new UnmarshalCache(runtime); this.proc = proc; this.inputStream = in; this.taint = taint; this.untrust = untrust; int major = in.read(); // Major int minor = in.read(); // Minor if(major == -1 || minor == -1) { throw new EOFException("Unexpected end of stream"); } if(major != Constants.MARSHAL_MAJOR || minor > Constants.MARSHAL_MINOR) { throw runtime.newTypeError(String.format("incompatible marshal file format (can't be read)\n\tformat version %d.%d required; %d.%d given", Constants.MARSHAL_MAJOR, Constants.MARSHAL_MINOR, major, minor)); } }
public UnmarshalStream(Ruby runtime, InputStream in, IRubyObject proc, boolean taint, boolean untrust) throws IOException { this.runtime = runtime; this.cache = new UnmarshalCache(runtime); this.proc = proc; this.inputStream = in; this.taint = taint; this.untrust = untrust; int major = in.read(); // Major int minor = in.read(); // Minor if(major == -1 || minor == -1) { throw new EOFException("Unexpected end of stream"); } if(major != Constants.MARSHAL_MAJOR || minor > Constants.MARSHAL_MINOR) { throw runtime.newTypeError(String.format("incompatible marshal file format (can't be read)\n\tformat version %d.%d required; %d.%d given", Constants.MARSHAL_MAJOR, Constants.MARSHAL_MINOR, major, minor)); } }
public UnmarshalStream(Ruby runtime, InputStream in, IRubyObject proc, boolean taint) throws IOException { assert runtime != null; assert in != null; // Older native java ext expects proc can be null (spymemcached.jruby at least). if (proc == null) proc = runtime.getNil(); this.runtime = runtime; this.cache = new UnmarshalCache(runtime); this.proc = proc; this.inputStream = in; this.taint = taint; int major = in.read(); // Major int minor = in.read(); // Minor if(major == -1 || minor == -1) { throw new EOFException("Unexpected end of stream"); } if(major != Constants.MARSHAL_MAJOR || minor > Constants.MARSHAL_MINOR) { throw runtime.newTypeError(String.format("incompatible marshal file format (can't be read)\n\tformat version %d.%d required; %d.%d given", Constants.MARSHAL_MAJOR, Constants.MARSHAL_MINOR, major, minor)); } }
public UnmarshalStream(Ruby runtime, InputStream in, IRubyObject proc, boolean taint) throws IOException { assert runtime != null; assert in != null; // Older native java ext expects proc can be null (spymemcached.jruby at least). if (proc == null) proc = runtime.getNil(); this.runtime = runtime; this.cache = new UnmarshalCache(runtime); this.proc = proc; this.inputStream = in; this.taint = taint; int major = in.read(); // Major int minor = in.read(); // Minor if(major == -1 || minor == -1) { throw new EOFException("Unexpected end of stream"); } if(major != Constants.MARSHAL_MAJOR || minor > Constants.MARSHAL_MINOR) { throw runtime.newTypeError(String.format("incompatible marshal file format (can't be read)\n\tformat version %d.%d required; %d.%d given", Constants.MARSHAL_MAJOR, Constants.MARSHAL_MINOR, major, minor)); } }