private Byte[] CreateByteCode( MethodDefinition method, TinyBinaryWriter writer) { if (!method.HasBody) { return new Byte[0]; } using(var stream = new MemoryStream()) { var codeWriter = new CodeWriter( method, writer.GetMemoryBasedClone(stream), _context.StringTable, _context); codeWriter.WriteMethodBody(); return stream.ToArray(); } }
private Byte[] CreateByteCode( MethodDefinition method) { if (!method.HasBody) { return new Byte[0]; } using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var codeWriter = new CodeWriter( method, TinyBinaryWriter.CreateBigEndianBinaryWriter(writer), _fakeStringTable, _context); codeWriter.WriteMethodBody(); return stream.ToArray(); } }