public static object Dump(WriterSites/*!*/ sites, RubyModule/*!*/ self, object obj, [NotNull]RubyIO/*!*/ io, [Optional]int? limit) { BinaryWriter writer = io.GetBinaryWriter(); MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit); dumper.Dump(obj); return io; }
public static byte[] GetBytes(object o, int version) { MarshalWriter mw = new MarshalWriter(version); mw.WriteObject(o); return(mw.GetBytes()); }
static byte[] ObjectToBytes(object o) { MarshalWriter mw = new MarshalWriter(); mw.WriteObject(o); return(mw.GetBytes()); }
public static object Dump(WriterSites /*!*/ sites, RubyModule /*!*/ self, object obj, [NotNull] RubyIO /*!*/ io, [Optional] int?limit) { BinaryWriter writer = io.GetBinaryWriter(); MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit); dumper.Dump(obj); return(io); }
public static MutableString Dump(WriterSites/*!*/ sites, RubyModule/*!*/ self, object obj, int limit) { MemoryStream buffer = new MemoryStream(); BinaryWriter writer = new BinaryWriter(buffer); MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit); dumper.Dump(obj); return MutableString.CreateBinary(buffer.ToArray()); }
public static MutableString Dump(WriterSites /*!*/ sites, RubyModule /*!*/ self, object obj, int limit) { MemoryStream buffer = new MemoryStream(); BinaryWriter writer = new BinaryWriter(buffer); MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit); dumper.Dump(obj); return(MutableString.CreateBinary(buffer.ToArray())); }
internal SubclassData(MarshalWriter /*!*/ marshaller, object /*!*/ obj, Type type) { RubyClass libClass = marshaller._context.GetClass(type); RubyClass theClass = marshaller._context.GetClassOf(obj); if (libClass != theClass && !(obj is RubyStruct)) { marshaller._writer.Write((byte)'C'); marshaller.WriteSymbol(theClass.Name); } }
public static object Dump(RubyModule /*!*/ self, object obj, object io, [Optional] int?limit) { Stream stream = null; if (io != null) { stream = new IOWrapper(self.Context, io, FileAccess.Write); } if (stream == null || !stream.CanWrite) { throw RubyExceptions.CreateTypeError("instance of IO needed"); } BinaryWriter writer = new BinaryWriter(stream); MarshalWriter dumper = new MarshalWriter(writer, self.Context, limit); dumper.Dump(obj); return(io); }
public static object Dump(WriterSites/*!*/ sites, RespondToStorage/*!*/ respondToStorage, RubyModule/*!*/ self, object obj, object io, [Optional]int? limit) { Stream stream = null; if (io != null) { stream = RubyIOOps.CreateIOWrapper(respondToStorage, io, FileAccess.Write); } if (stream == null || !stream.CanWrite) { throw RubyExceptions.CreateTypeError("instance of IO needed"); } BinaryWriter writer = new BinaryWriter(stream); MarshalWriter dumper = new MarshalWriter(sites, writer, self.Context, limit); dumper.Dump(obj); return io; }
internal SubclassData(MarshalWriter/*!*/ marshaller, object/*!*/ obj, Type type) { RubyClass libClass = marshaller._context.GetClass(type); RubyClass theClass = marshaller._context.GetClassOf(obj); if (libClass != theClass && !(obj is RubyStruct)) { marshaller._writer.Write((byte)'C'); marshaller.WriteSymbol(theClass.Name); } }
public static byte[] GetBytes (object o, int version) { MarshalWriter mw = new MarshalWriter (version); mw.WriteObject (o); return mw.GetBytes (); }
static byte[] ObjectToBytes(object o) { MarshalWriter mw = new MarshalWriter(); mw.WriteObject(o); return mw.GetBytes(); }