public static object Load(ReaderSites /*!*/ sites, RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] RubyIO /*!*/ source, [Optional] Proc proc) { BinaryReader reader = source.GetBinaryReader(); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return(loader.Load()); }
public static object Load(ReaderSites /*!*/ sites, RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] MutableString /*!*/ source, [Optional] Proc proc) { BinaryReader reader = new BinaryReader(new MemoryStream(source.ConvertToBytes())); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return(loader.Load()); }
internal MarshalReader(ReaderSites /*!*/ sites, BinaryReader /*!*/ reader, RubyGlobalScope /*!*/ globalScope, Proc proc) { _sites = sites; _reader = reader; _globalScope = globalScope; _proc = proc; _symbols = new Dictionary <int, Symbol>(); _objects = new Dictionary <int, object>(); }
public static object Load(ReaderSites /*!*/ sites, RespondToStorage /*!*/ respondToStorage, RubyScope /*!*/ scope, RubyModule /*!*/ self, object source, [Optional] Proc proc) { Stream stream = null; if (source != null) { stream = RubyIOOps.CreateIOWrapper(respondToStorage, source, FileAccess.Read); } if (stream == null || !stream.CanRead) { throw RubyExceptions.CreateTypeError("instance of IO needed"); } BinaryReader reader = new BinaryReader(stream); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return(loader.Load()); }
internal MarshalReader(ReaderSites/*!*/ sites, BinaryReader/*!*/ reader, RubyGlobalScope/*!*/ globalScope, Proc proc) { _sites = sites; _reader = reader; _globalScope = globalScope; _proc = proc; _symbols = new Dictionary<int, Symbol>(); _objects = new Dictionary<int, object>(); }
public static object Load(ReaderSites/*!*/ sites, RespondToStorage/*!*/ respondToStorage, RubyScope/*!*/ scope, RubyModule/*!*/ self, object source, [Optional]Proc proc) { Stream stream = null; if (source != null) { stream = RubyIOOps.CreateIOWrapper(respondToStorage, source, FileAccess.Read); } if (stream == null || !stream.CanRead) { throw RubyExceptions.CreateTypeError("instance of IO needed"); } BinaryReader reader = new BinaryReader(stream); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return loader.Load(); }
public static object Load(ReaderSites/*!*/ sites, RubyScope/*!*/ scope, RubyModule/*!*/ self, [NotNull]RubyIO/*!*/ source, [Optional]Proc proc) { BinaryReader reader = source.GetBinaryReader(); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return loader.Load(); }
public static object Load(ReaderSites/*!*/ sites, RubyScope/*!*/ scope, RubyModule/*!*/ self, [NotNull]MutableString/*!*/ source, [Optional]Proc proc) { BinaryReader reader = new BinaryReader(new MemoryStream(source.ConvertToBytes())); MarshalReader loader = new MarshalReader(sites, reader, scope.GlobalScope, proc); return loader.Load(); }