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
1 answer

Any alternative about CS0233 for sizeof(T) in StructLayoutAttribute?

Wrote the following struct to minimize the number of types for vectors with different components: [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3 * sizeof(T))] public struct Vector3 where T : unmanaged { public T X, Y, Z; public…
aybe
  • 15,516
  • 9
  • 57
  • 105
1
vote
1 answer

How to pass a C# string array to JavaScript using JSExport in WebAssembly?

Following is the boilerplate example from VS2022 WebAssembly console template. I'm trying to extend it to pass a C# array to read from the JS. I'm very new to WebAssembly, your help would be much appreciated. C# using System; using…
Kaf
  • 33,101
  • 7
  • 58
  • 78
1
vote
0 answers

Why jboss uses deprecated DOMSerializerImpl org.apache.xerces 2.12.0.SP03

I've got an issue while deploing with putting key value into the infinispan cache some object ISPN000559: Cannot marshall 'class org.infinispan.marshall.protostream.impl.MarshallableUserObject': org.w3c.dom.ls.LSException from the stacktrace I see…
Victoria
  • 21
  • 4
1
vote
1 answer

Allocating object inside unmanaged memory in C#

First of all I know I shouldn't even try to do it, but i like to try things that don't make sense. I was intrigued by this post and modified to my needs and I wanted to improve it by implementing allocation of arrays inside unmanaged memory. public…
Feralnex
  • 61
  • 5
1
vote
1 answer

Correctly Convert const char* in C++ dll to string in C#

I'm writing a program that passes a const char* from my C++ dll into my C# code as a string. Certain characters don't pass the way I intend, which interferes with processing the string afterward. For example, "ß.\x3" in C++ becomes "ß®\x3" when it…
JonRicardo
  • 15
  • 5
1
vote
3 answers

Marshalling utf8 encoded chinese characters from C# to C++

I'm marshaling some Chinese characters which have the decimal representation (utf8) as 228,184,145,230,161,148 however when I receive this in C++ I end up with the chars -77,-13,-67,-37 I can solve this using a sbyte[] instead of string in c#, but…
ZWang
  • 832
  • 5
  • 14
1
vote
1 answer

Marshal c# struct to C struct is not working

I want to call the following C function from C#, but it doesn't work. The C code is part of the .so file. In my case the code should run in an Linux environment! The C# Code is part of a console app which uses the .so file /** * \brief Register a…
Simon
  • 67
  • 6
1
vote
2 answers

Converting a C++ .exe project to a dll

Microsoft provides the source code of vshadow to manipulate VSS (Volume Shadow Service [shadow copy]), and I've modified it a bit but I want to make it into a dll so I can use it in my C# projects. I don't know exactly how to go about doing that,…
Malfist
  • 31,179
  • 61
  • 182
  • 269
1
vote
1 answer

Unmarshal JSON date string to BSON date in Golang

This should be easy but I'm not making much headway. Say I have JSON with a UTC date like this: { "name": "Lex", "dob": "2022-11-01T06:30:30.639326208Z" } I'd like to insert it in a MongoDB collection. In Go, I do: import ( …
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
1
vote
2 answers

Go How to deal with float infinity before converting to JSON

I've come across a situation where I have some float64 fields that could be infinity/NaN and trying to marshal to JSON would result in an error regarding +Inf type isn't supported. type Something interface { Id string `firestore:"id"` NumberA…
Galty
  • 37
  • 6
1
vote
1 answer

Flask restx response marshalling

I know that response marshalling looks something like this: from flask_restx import fields some_object = { 'id': fields.Integer(reqired=True), 'name': fields.String(required=True) } @api.route('', methods=['POST']) class…
cassham
  • 21
  • 2
1
vote
1 answer

How struct size effects automatic marshaling in .NET

I am working on a C# .NET wrapper that wraps an unmanaged C++ Driver. The logic is to create a C# class that has methods which wrap the DLLImport entries. One of the functions of the unmanaged driver expects pointer to a struct. I know that the…
AntGeorge
  • 63
  • 1
  • 1
  • 9
1
vote
1 answer

How do I copy part of a custom struct to a different struct in Golang

I have been stuck with this for a couple of hours now and was hoping one of you could help me out with an elegant solution. Basically, I have the following struct: type GetERC20TransferResponse struct { Data struct { Address string …
1
vote
2 answers

Trouble with DllImport syntax calling GetJob() from a printer driver library

I'm trying to call the GetJob() method documented here. I think I'm having problems with the syntax of the routine right now, both calling and defining. I've finally got something to compile which is the following. [DllImport( "winspool.drv", …
Ultratrunks
  • 2,464
  • 5
  • 28
  • 48
1
vote
1 answer

Go Gin: how to marshall []byte to json without quotes

I try to return json from my test app. The result returns with quotes and escape characters. How to return raw json? type Row struct { Id int `json:"id"` Value string `json:"value"` Name string `json:"name"` } func GetTestData()…
askuzenkov
  • 89
  • 6
1 2 3
99
100