serialization

Reading VC++ CArchive Binary Format (or Java reading (CObArray))

核能气质少年 提交于 2020-01-11 10:09:12
问题 Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc). However, I am currently running into issues while trying to bring over the CObArray data, as there seems to be a rather large header that is opaque to me, and it is unclear how it is persisting object type information. Is there a set

Deserializing JSON String to VB.net Object

 ̄綄美尐妖づ 提交于 2020-01-11 09:05:10
问题 I'm trying to convert a JSON String into an VB.net Object to get easy access to alle the data in the JSON String. My JSON String looks like this: { "status": "ok", "count": 4, "data": [ { "clan_id": 500002846, "nickname": "Azrael", "id": 500429872 }, { "clan_id": null, "nickname": "Azrael0", "id": 500913252 }, { "clan_id": 500028112, "nickname": "Azrael0313", "id": 504109422 }, { "clan_id": null, "nickname": "Azrael7", "id": 501594186 } ] } Now I'm trying to deserialize this String into an VB

Serialization:java.io.StreamCorruptedException: invalid stream header: 0AACED00

强颜欢笑 提交于 2020-01-11 08:47:47
问题 I'm a student practicing my File IO skills and I am coming up against a problem with reading Objects from a file using ObjectInputStream. The code is consistently throwing an InvalidClassException and I can't find how the code is throwing it online or by trial and error. Here's my code: import java.io.*; import java.util.ArrayList; import java.util.List; public class ReadFromFile { String filename; List<Object> os; public ReadFromFile(String filename) { this.filename = filename; os = new

XML to C# class

耗尽温柔 提交于 2020-01-11 06:28:10
问题 Can anyone give me some advice? An API I'm consulting generates a pattern like this: <?xml version="1.0"?> <ChatXMLResult> <Generator>AppServer.network.lcpdfr.com</Generator> <Version>1000</Version> <Time>1305910998</Time> <Signature>a0f1f6bea66f75de574babd242e68c47</Signature> <FilteredResultSet>1</FilteredResultSet> <Messages> <Message> <ID>1</ID> <UID>9</UID> <DisplayName>Jay</DisplayName> <UserName>jaymac407</UserName> <Time>1305900497</Time> <Area>Masterson St</Area> <Message>Test<

trying to serialize and deserialize an xml file using VB.net

孤街醉人 提交于 2020-01-11 04:00:06
问题 The xml file should like this after I serialize and then I want to deserialize this in vb.net. I am a begginer in programming. Any help is appreciated. <?xml version="1.0"?> <Countries> <Country> <CID>1</CID> <CountryName>India</CountryName> <States> <State> New Delhi </State> <State> Maharashtra </State> <State> Rajasthan </State> </States> </Country> <Country> <CID>2</CID> <CountryName>United States</CountryName> <States> <State> Washington </State> <State> Texas </State> </States> <

How to avoid null values serialization in HashMap?

梦想与她 提交于 2020-01-10 23:04:34
问题 I would like to serialize a HashMap as a string through the Jackson JSON processor. For example: String strMap = getMapper().writeValueAsString(myHashMap); result output -> {"r_id":6,"a_am":null,"smb":"Submit","a_li":null,"l_id":878,"pos":[1345,1346,1347]} I don't know how to disable null values serialization for Map. It works fine only for POJO if configure the Jackson like this: mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL); 回答1: For what it's worth, Jackson

How to avoid null values serialization in HashMap?

て烟熏妆下的殇ゞ 提交于 2020-01-10 23:03:23
问题 I would like to serialize a HashMap as a string through the Jackson JSON processor. For example: String strMap = getMapper().writeValueAsString(myHashMap); result output -> {"r_id":6,"a_am":null,"smb":"Submit","a_li":null,"l_id":878,"pos":[1345,1346,1347]} I don't know how to disable null values serialization for Map. It works fine only for POJO if configure the Jackson like this: mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL); 回答1: For what it's worth, Jackson

Custom .NET Serialization doesn't seem to work

随声附和 提交于 2020-01-10 20:12:06
问题 I am using BinaryFormatter to serialize a collection of objects of class A stored in a System::Collections::Generic::List<A^>^ . I have added the [Serializable] tag and have implemented ISerializable in class A (both GetObjectData and the special constructor). When deserializing, I find that the list is deserialized and contains the same number of elements as was serialized. However, each of these elements is a null reference. I've checked for thrown exceptions and am sure that it is not the

.NET, C#: How to add a custom serialization attribute that acts as ISerializable interface

狂风中的少年 提交于 2020-01-10 19:56:07
问题 I am doing some serialization of db linq objects, which contain EntitySet and EntityRef classes. I found a pretty easy way to deal with serialization of these classes, by simply using ISerializable to properly handle members of this type (converting them to lists for serialization, and undoing it on deserialization). However, it would be really nice if I could do: [Serializable] [SerializeLinqEntities] partial class Person { ... } Instead of: partial class Person : ISerializable { public

How can I serialize an interface?

帅比萌擦擦* 提交于 2020-01-10 18:45:34
问题 Suppose I have a Serializable class ShapeHolder that owns an object that implements a Serializable Shape interface. I want to make sure the correct concrete shape object is saved (and the correct type is later restored). How can I accomplish this? interface Shape extends Serializable {} class Circle implements Shape { private static final long serialVersionUID = -1306760703066967345L; } class ShapeHolder implements Serializable { private static final long serialVersionUID =