seasonouc / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
0 stars 0 forks source link

byte arrays on protostuff-runtime were not treated as scalar fields #90

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There is currently a lot of overhead when serializing byte arrays.
The expected behavior is to treat it as a scalar field and serialize via  
Output.writeByteArray.

Instead, they are treated as regular arrays (w/c includes extra metadata on 
serialization)

E.g

public class Foo
{
    byte[] b;
    List<byte[]> rb;
    // Map<String,byte[]> // maps should have same behavior as well.
}

should be serialized exactly like it was:

message Foo {
    optional bytes b = 1;
    repeated bytes b = 2;
}

Original issue reported on code.google.com by david.yu...@gmail.com on 24 Oct 2011 at 7:26

GoogleCodeExporter commented 8 years ago
correction (typo):
repeated bytes rb = 2;

Original comment by david.yu...@gmail.com on 24 Oct 2011 at 7:29

GoogleCodeExporter commented 8 years ago
fixed @ rev 1407.

Original comment by david.yu...@gmail.com on 24 Oct 2011 at 8:57