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 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())); }
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; }