Most voted "serialization" questions
In the context of data storage and transmission, serialization is the process of saving an object on a storage medium (such as a computer file or memory buffer) or transmitting it over a network connection, either in binary form or in text format such as XML. This byte series can be used to recreate an object with the same internal state as the original.
Learn more…72 questions
Sort by count of
-
31
votes3
answers21968
viewsWhat is the purpose of the Serializable interface?
Example of implementation: public class MyClass implements Serializable{ private static final long serialVersionUID = 1L; }
-
26
votes2
answers9155
viewsWhat is serialization? When to use? How to implement in C#?
[Serializable] public class Pessoa { public string Nome { get; set; } public string Cpf { get; set; } } There’s only one kind of serialization? What alternatives not to need serialize an object?…
-
21
votes1
answer778
viewsWhat are error-correcting codes?
What they are and how they work error-correcting codes (error-correcting code)? I’ve seen this concept for example in QR Code (where partially damaged and/or imperfectly captured code is still…
mathematics serialization error-recovery content-codingasked 9 years, 4 months ago mgibsonbr 80,631 -
16
votes3
answers8395
viewsDeserialize JSON Array in an Object Array
Good afternoon, I decided to ask because I’ve been holding on to this for three days and as much as I’ve looked, I haven’t found a solution to my problem. Access a Web Service via C#, Httpclient,…
-
15
votes3
answers243
viewsDoes C# have native serialization?
In PHP there is a language proper data serialization feature. I mean: I’m not talking about using JSON or XML, but I speak of a serialization in a format that is proper to the language. For example,…
-
6
votes3
answers427
viewsHow can I include the 'Submit' button in the 'POST' matrix generated by 'serialize'?
On the forms, I have the button like submit that when clicked will be intercepted by jQuery in order to make validations to the content of the form before sending it to PHP process via Ajax. Form…
-
5
votes3
answers1018
viewsSerialize XML for REST API with Correct Accent
I am creating a small read-only REST API service on a client system. It uses Spring MVC to fulfill the requests and the purpose of each request is to return a JSON with certain information to…
-
5
votes1
answer73
viewsSerialization of exceptions
According to the msdn documentation, an exception should be serialized if it should be propagated outside the Assembler. In visual studio, I have a solution with some projects, among them a class…
-
5
votes1
answer1435
viewsWhat’s the Youtube show for?
If I don’t declare that constant (serialVersionUID) in a class that implements the interface Serializable, I get a Warning. But what is this constant for anyway? Its value interferes with the…
-
5
votes1
answer108
viewsHow to serialize an Exception with closure
I am trying to serialize the error generated exceptions to record a log with all the information, but the problem is that some exceptions may come with a closure within the trace and fire the…
-
5
votes4
answers239
viewsIgnore class name in XML serialization
I need to serialize a class for XML, for example: public class Pessoa { public string nome { get; set; } public int idade { get; set; } public Endereco endereco { get; set; } } public class Endereco…
-
5
votes1
answer146
viewsHow to view data from a serialized Java file?
I’m starting in Java and I need to make a system that registers students and saves their data in a serialized file. I can even create and save the data in the serialized file (I think rsrs) but I…
-
4
votes2
answers465
viewsHow to change the JSON serialization format of PHP Datetime?
In PHP, when I use a json_encode on an object of the type DateTime, it displays the following result: $date = new DateTime(); echo json_encode(compact('date'), JSON_PRETTY_PRINT); Exit: { "date": {…
-
3
votes1
answer1261
viewsHow to recover Codeigniter session data directly from database?
I am trying to recover data from my table ci_sessions of CodeIgniter that are saved in a serialized way. $data = $this->db->get_where('ci_sessions', array('id' => $id))->row('data');…
-
3
votes1
answer625
viewsSerialization of lists in C#classes
Good afternoon guys, I’m running an Nfe project for emission, so I opted, after searching use class serialization to mount xml. Everything works very well, from a class structure that defined the…
-
3
votes3
answers285
viewsHow to serialize a class to file in C#?
How do I serialize a class to a C file#? I have a class [Serializable] public class MyClass { public int MyNumber { get; set; } public string MyName { get; set; } }…
-
3
votes3
answers462
viewsJSON serialization and deserialization in desktop application
{"result":[[{"code reduced":"019076-3","Stock":200,"Price":900.77,"Price":225.19,"Description":" ASUS AMD RADEON R5 VIDEO CARD 230 1GB DDR3 64BITS R5230-SL-1GD3-L *IMP","Group":"VIDEO…
-
3
votes2
answers907
viewsUnexpected type when serializing web API
I am trying to use the Web Api and getting this error while trying to serialize an array. The 'HT.Data.Client' type with data contract name 'Client:http://schemas.datacontract.org/2004/07/HT.Data'…
-
3
votes1
answer40
viewsJava: Convert point-delimited strings to nested JSON
I have a lot of attributes coming as point-delimited strings like "company.id", "company.address.number", "user.name", "isAtive", and I need to create a nested JSON with its respective values. These…
-
3
votes1
answer512
viewsSerialize composite object into a single json
With Newtonsoft.Json, to the next object: public class Person { public string Name { get; set; } public string GeneralText { get; set; } public Address Address { get; set; } } public class Address {…
-
3
votes1
answer35
viewsHow to serialize Object for yaml in . NET?
We can serialize objects (I’ll use as an example C#) for XML, using the class System.Xml.Serialization.XmlSerializer, for example: var obj = new AlgumaClasse();…
-
2
votes1
answer1114
viewsHow not to serialize some attributes in Restful calls with Jersey and Jackson
I’m using the Jersey library in conjunction with the Jackson library to use REST-like web services. In calls, I usually use the following code that transforms a particular entity into a JSON to be…
-
2
votes1
answer321
viewsSend UTC Datetime Javascript to C#
I have an ASP.Net MVC project as follows: In my view I have a Javascript variable that keeps a date: var hoje = new Date(); In my controller have a action which receives via AJAX the value of the…
javascript c# asp.net-mvc datetime serializationasked 9 years, 2 months ago Jedaias Rodrigues 6,718 -
2
votes1
answer320
viewsVariables with special characters
Hello, I’m trying to create a gender class: [DataContract, Serializable] public class XMLCM5050 : XmlApi { [DataMember] public string $name{ get; set; } [DataMember] public string $age{ get; set; }…
-
2
votes1
answer383
viewsSerialization - Webapi for WCF with base type property (Abstract)
I have a problem here where I have a Webapi consuming a WCF. I’m basically having trouble getting into WCF a property that’s the base type of class I’m actually sending. I’ll set an example to make…
-
2
votes2
answers253
viewsReplace in large string or split loop
I have a multidimensional array with some routes and need to do the conversion of some elements defined as: (alpha), (int), (id), etc. As it is an array, at the moment I use a loop to do the…
-
2
votes0
answers47
viewsAre there large differences in the "binary recording" of a file, when entering lists or dictionaries?
I’m developing a language project C# where I need to use files to store the data circulating in the data structures. Turns out I had the whole project all worked out, I wasn’t layering. I was…
-
2
votes1
answer544
viewsCheck null or empty fields in an entity without consecutive use of "if-Else"
In a system integration there are data updates on both sides, where you get the record of Side A and the record of side B. If there are null fields in A and these exist in B then A is supplemented…
-
1
votes1
answer63
viewsIs it possible to serialize closures in PHP?
It is possible to serialize closures in PHP (even if it is not natively)? Because PHP generates a Fatal Error while trying to do so: $func = function ($a, $b) { return $a + $b; }; serialize($func);…
-
1
votes1
answer157
viewsRemove Xnamespace in Xelement c#
I am in need of removing the Xnamespace that enters as default on an rss return. Follow the code below: static void Main(string[] args) { XNamespace ns = "http://search.yahoo.com/mrss"; var item =…
-
1
votes0
answers61
viewsVB.NET - How to make a Loopback Serial Test program in Universal Windows Platform?
I have a problem translating the code C# to VB.NET on the UWP platform making a Serial UART Test Example made available by the Microsoft website. The program in C# is working perfectly, but when I…
-
1
votes1
answer66
viewsHow to set acceptable single values for an Enum property in a Serializable class?
Given a enum as an example: public enum IcmsCst { [XmlEnum("00")] Cst00, [XmlEnum("10")] Cst10, [XmlEnum("20")] Cst20, ... } There is a form of annotation so that I could specify that a certain type…
-
1
votes3
answers1002
viewsNamespace Serialization with link
I’m working with Serialization, I’m adding Namespace to two tags, nfeProc and Nfe. I can normally add the following: [XmlRoot("nfeProc", Namespace = "http://www.portalfiscal.inf.br/nfe")] In XML:…
-
1
votes1
answer101
viewsWhy is the Serializable interface empty in JDK source code?
I know what serialization is and what use it is. I also know when not to use it. I’ve read item 74 of the Java Effect. My question is, what is the purpose of an empty interface, in which there is…
-
1
votes1
answer20
viewsHow to remove parts of a field name in a serialized structure?
I am selecting my form to then convert it to JSON, and I need to remove the string "PessoaViewModel." of all Fields. The serialized data looks like this:…
-
1
votes1
answer253
viewsPython Load Serialization Files
Hello, I’m studying Python for some time and doing some programs to join with Arduino. My question is on good practices in file uploading. I want to make a program that interprets files. My idea was…
-
1
votes1
answer297
viewsPHP Object Injection
On the website of OWASP It explains this kind of flaw that makes code injection possible. But one part was not clear to me and if anyone who understands can clarify me. The excerpt says the…
-
1
votes1
answer424
viewsHow to create a mapped file with an Std::map
I’m trying to use a Std::map that allocates objects within a file mapped using boost, with a vector worked but with a map not #include <boost/interprocess/managed_mapped_file.hpp> #include…
-
1
votes0
answers702
viewsHow to write objects to a file and read these objects
I need to record the created objects in a TXT file and then read the recorded files and show the recorded objects. I searched in several places but I’m not able to solve my problem. I have a class…
-
1
votes1
answer197
viewsIdentify EOF in a Datainputstream
I am making a program that needs to read a binary file and go extracting some information from it, what I have so far is the following: public void processarArquivo() throws Exception{ try {…
-
1
votes1
answer771
viewsXML Serialization, how to do
I need to generate XML in the TISS standard of the ANS. I got the schemas available on website, and by xsd2Code generated tissV3_03_02 classes. I installed an object of the type ctm_guiaLote and now…
-
1
votes0
answers263
viewsHow to change the prefix and name of an attribute in an XML tag in an NFS-e?
Hello, I’m beginner in NFS-e development and I’m not able to change the prefix and attribute name below, I put in the code so that it was xsi, but regardless of what I put it generates the xml with…
-
1
votes1
answer46
viewsClass structure for
I have the following XML returned by a service: <?xml version="1.0" encoding="iso-8859-1" ?> <mensagem tipo="0000" version="1.0"> <registro tipo="0000" version="1.0">…
-
1
votes1
answer1816
viewsc# Json returning backslash
I’m new to the web, I’m trying to return a json but it comes with bars like this: {\"NomeUsuario\":\"TESTE\",\"TelefoneUsuario\":\"1111111111\"} How do I make him look like this:…
-
1
votes0
answers111
viewsJava: Streamcorruptedexception in object serialization/deserialization
I’m conducting an exercise involving serialization and deserialization in Java. When running the program I am getting the following error in the IDE console (Netbeans): set 08, 2018 5:07:53 PM…
-
1
votes1
answer239
viewsJSON Regular Expression and Deserialization Dictionary
I am developing a system that receives JSON from several layouts for a single channel and the Router class must identify which layout is by regular expression and perform the deserialization for the…
-
1
votes1
answer235
viewsXML serialization/deserialization C#
Good night! I can’t use the data I do the XML deserialization, there is no exception or anything like that... I already checked the path, data but I can not list the data... XML: <?xml…
-
1
votes2
answers843
viewsSerialize JSON List in Flutter
I have an application in Fluter, and I have a return Json with List. I wanted to serialize the List to display it at a certain point, but I couldn’t find a way to do that. An example of my code:…
-
1
votes1
answer213
viewsHow to ignore a Serialization?
I’m having trouble serializing a Socket class with BinaryFormatter, tried to use the attribute NonSerializedAttribute, but it just doesn’t work for this kind of property below.…
-
0
votes3
answers430
viewsProblem when importing model
Hello, I’m not getting the import of this model have the model: class Contrato(models.Model): within models.py and inside my serializers.py need to do import from models import Contrato nor from…