Questions tagged [serialization]

Serialization is the process by which data-structures are converted into a format that can be easily stored or transmitted and subsequently reconstructed.

Serialization is the process of converting a or object's state into a format that can be stored (for example, in a flat file or memory ) or transmitted over a network, to be reconstructed later maintaining data integrity - typically in a different run-time environment which may or may not be on the same computer.

The process of serializing an object is sometimes referred to as - however depending on the context / language this term may take on a slightly different meaning. The process of reconstructing a data structure from its serialized form is known as .

Popular formats for serialization are and .

33160 questions
11
votes
1 answer

How to append extra data to the existing serializer in django

I am new to django rest-framework serializers. views.py @csrf_exempt @api_view(['GET']) def getAllAvailableEmps(request): if request.method == 'GET': try: roleId = request.GET['emp_role_id'] getEmp =…
user1335606
  • 479
  • 2
  • 5
  • 14
11
votes
5 answers

Benefits of [NonSerialized] when [Serializable] is not used

I'm looking through some existing code in a project I'm working on, and I found a class that is implemented as: public class ThingOne { private int A; private int B; [NonSerialized] private System.Timers.Timer timer1; } Shouldn't…
Tim W.
  • 834
  • 1
  • 9
  • 18
11
votes
1 answer

"max allowed size 128000 bytes, actual size of encoded class scala" error in akka remoting

I want to use Akka Remoting to exchange message over network between actors, but for large String message i got the following error: akka.remote.OversizedPayloadException: Discarding oversized payload sent to Actor :: max allowed size 128000…
Saeed Zarinfam
  • 9,818
  • 7
  • 59
  • 72
11
votes
1 answer

Spark reading python3 pickle as input

My data are available as sets of Python 3 pickled files. Most of them are serialization of Pandas DataFrames. I'd like to start using Spark because I need more memory and CPU that one computer can have. Also, I'll use HDFS for distributed…
Michael Hooreman
  • 582
  • 1
  • 5
  • 16
11
votes
1 answer

Extend django rest framework to allow inheriting context in nested serializers

I'm using Django 1.6 (very soon upgrading to 1.8), Python 2.7, and DRF 3.2.5 (very soon upgrading to latest). I've got a set of deeply nested serializers (~10 levels deep, with a total of 20-30 models that are serialized). I'm trying to add a…
o_c
  • 3,965
  • 1
  • 22
  • 22
11
votes
6 answers

Is there a built in way in .Net AJAX to manually serialize an object to a JSON string?

I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the and…
travis
  • 35,751
  • 21
  • 71
  • 94
11
votes
3 answers

How to Serialize generic foreign key In DRF

I have model with generic foreign key and I want to serialize that model. model.py: class AddressType(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object =…
Naresh
  • 1,842
  • 2
  • 24
  • 36
11
votes
5 answers

writing many java objects to a single file

how can I write many serializable objects to a single file and then read a few of the objects as and when needed?
Anupam
  • 870
  • 4
  • 9
  • 19
11
votes
4 answers

Deserializing json array using gson

Continuing from this question. I'm having trouble deserializing the following json array (Sorry for the size): "geometry": { "type": "Polygon", "coordinates": [ [ [ 771230.894373, 4422896.962001 ], [ 804804.852796, 4451159.130080 ], […
Frederik Wordenskjold
  • 10,031
  • 6
  • 38
  • 57
11
votes
1 answer

DjangoRestFramework ModelSerializer DateTimeField only converting to current timezone at object creation

Update: This behaviour was recognized as a bug and resolved in django-rest-framework 3.7. Serializers will now consistently display times according to the server's timezone:…
Jonathan Richards
  • 1,414
  • 1
  • 16
  • 20
11
votes
2 answers

flink - using dagger injections - not serializable?

Im using Flink (latest via git) to stream from kafka to cassandra. To ease unit testing Im adding dependency injection via Dagger. The ObjectGraph seems to be setting itself up properly but the 'inner objects' are being flagged as 'not…
ethrbunny
  • 10,379
  • 9
  • 69
  • 131
11
votes
2 answers

Does a Buffered ObjectInputStream exist?

I am deserializing an object from a file that is 350KB in size, and its taking rather a long time. My computer science TA told me that there is a way to use a Buffered reader along with the ObjectInputStream to greatly increase performance. I…
Aymon Fournier
  • 4,323
  • 12
  • 42
  • 59
11
votes
3 answers

Got AttributeError when attempting to get a value for field on serializer

I get the following error: Got AttributeError when attempting to get a value for field first_name on serializer AthleteSerializer. The serializer field might be named incorrectly and not match any attribute or key on the QuerySet instance. Original…
user1283776
  • 19,640
  • 49
  • 136
  • 276
11
votes
1 answer

Formatting protobuf for logs

Given a simple protobuf message with one string field : message Sample{ required string msg = 1; } and a sample code to print it : Sample message = Sample.newBuilder() .setMsg("some text") …
vach
  • 10,571
  • 12
  • 68
  • 106
11
votes
3 answers

Django ModelSerializer with ImageFIeld and HTTPS

I have a model News with an image and those News can be loaded via an JSON REST API. The server is signed with a certificate from an Authority and all request must be done with https. My problem is, the ModelSerializer serialize the ImageField with…
David Kühner
  • 793
  • 1
  • 7
  • 19