Questions tagged [marshalling]

Marshalling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission

Marshalling is the process of packing parameters to a message. The reverse process is called unmarshalling. The accurate definition of marshalling differs across programming languages such as Python, Java, and .NET, and in some contexts, is used interchangeably with serialization. The term is also used in RPC steps. For example marshalling in Java is the process of converting Java objects into XML format (JAXB).

Read more:

  1. Marshalling on WikiPedia
  2. Marshalling in Python
  3. Marshalling in Golang
  4. Marshalling in Java (JAXB)
  5. Marshalling in .NET
  6. Marshalling in Ruby
3730 questions
1
vote
2 answers

Unmarshalling using JAXB

I am new to java (coming from c#.net background) and was trying the above example to marshal and unmarshal. Following the link below Marshalling a List of objects implementing a common interface, with JaxB using the above technique as mentioned by…
1
vote
2 answers

Convert IntPtr to byte[] c#

I receive IntPtr value from C++ library method and i need to get byte[] array from this received IntPtr. When I try do this: byte[] myArray = new byte[Marshal.SizeOf(myReceivedIntPtr)]; Marshal.Copy(myReceivedIntPtr, myArray, 0,…
Timur Mustafaev
  • 4,869
  • 9
  • 63
  • 109
1
vote
1 answer

Custom string formatting in Grails JSON marshaller

I am looking for a way to do some string formatting through Grails JSON conversion, similar to custom formatting dates, which I found in this post. Something like this: import grails.converters.JSON; class BootStrap { def init = {…
ethaler
  • 155
  • 1
  • 7
1
vote
2 answers

C++ read void* data from a binary file as utf8 in Visual Studio 2010

I'm not very fluent in C++, to tell the truth. I have some binary data in memory under a type void* (which means, i think, a pointer to some unrepresentable something/nothing). The data are first taken from the file by fread. int readfile FILE…
Mirek
  • 4,013
  • 2
  • 32
  • 47
1
vote
1 answer

Marshal ushort[] over network

I created 2 simple console program and a simple structure. M11 Object is the test object that we want to send across network. using System.Runtime.InteropServices; using System; namespace MessageInfo { [StructLayout(LayoutKind.Sequential, Pack =…
Henri
  • 69
  • 1
  • 6
1
vote
1 answer

sharing memory between C# and native C++

is there a way to share memory between managed and native code, just like memory mapped files (I'am using .Net 2.0, so MMF is not available in this version), I'am new to this .Net, so what is actually marshalling? I've done this for communication…
uray
  • 11,254
  • 13
  • 54
  • 74
1
vote
1 answer

Matching namespaces on marshalling / unmarshalling in JAXB

Matching namespaces on marshalling / unmarshalling in JAXB I use JAXB to marshall / unmarshall XML. If I marshall an XML file like this:
belltower
  • 111
  • 6
1
vote
2 answers

Pinvoke struct translation from C++

The following is a bit of C++ that is verified working: typedef struct { PVOID buffer; UINT32 length; } DATA_BUFFER; typedef struct { DATA_BUFFER TxBuf [1]; DATA_BUFFER RxBuf [1]; } JVM_COMM_BUFFER; UINT32 SendAndRecv( IN JHI_HANDLE…
Daniel
  • 73
  • 2
  • 10
1
vote
2 answers

Marshalling .NET Object when class is in another namespace

I am having a problem with Marshalling an object across application domains in a .NET Windows Service. I have created two app's that marshal an object across an app domain and run code through a proxy MarshalByRefObject The first application was a…
dmck
  • 7,801
  • 7
  • 43
  • 79
1
vote
2 answers

Marshalling reference-types from C++ to C#

I want to invoke the following C++ function (exported by a DLL) from C#: void createVm( const jace::VmLoader& loader, const jace::OptionList& options, bool ignoreUnrecognized = true ); I've found documentation for marshaling primitives…
Gili
  • 86,244
  • 97
  • 390
  • 689
1
vote
1 answer

Marshal.GetDelegateForFunctionPointer fails

I'm trying to call an C function from a .NET application. Indeed I do the following: public unsafe class Simd { [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void MatrixMultiplyDelegate(float* left, float* right); …
Luca
  • 11,646
  • 11
  • 70
  • 125
1
vote
1 answer

JAXB 2.0 - how to marshal static inner classes

In JAXB 2.0 if you compile a schema to java classes and a class contains an inner class, are you required to do anything different while building your content tree from the generated classes? If so, what? Thanks!
Marc H
  • 1,228
  • 3
  • 18
  • 29
1
vote
1 answer

Marshal.StructureToPtr throw "Attempted to read or write protected memory" error

I have the following code and I'm new to Marshaling in .Net and have no idea why the Marshal.StructureToPtr only works when I allocate > 32 bytes to Marshal.AllocHGlobal. Anything <= 32, throw "Attempted to read or write protected memory. This is…
Henri
  • 69
  • 1
  • 6
1
vote
1 answer

Generating attribute option in xml using JAXB

I have to generate the following xml in my program using JAXB. ABC
Bangalore
Surya
  • 494
  • 3
  • 11
  • 23
1
vote
1 answer

Hash from String in Ruby: Marshal.load? (re-create the params hash from a Rails production.log)

I want to parse Rails production.log files and recreate the params Hash. I am stuck with the Marshal.load method, which actually expects the data to be marshalled. Well, the data is well-formed but it is a String and not in a Marshal expected…
z3cko
  • 3,054
  • 8
  • 40
  • 59