Thread
#serialization
    ansman

    ansman

    3 years ago
    I need to encode a Point(x, y) as
    [x, y]
    . There seems to be many ways of doing it. The simplest is to read it as a
    List<Float>
    but I’d like to avoid boxing the floats if possible on the JVM. There is
    beginStructure
    and
    beginCollection
    but no documentation on when to use either or.
    ansman

    ansman

    3 years ago
    Ah, there are a bunch of more useful methods to implement
    I would assume that
    addElement
    handles a lot of the stuff but maybe that’s not for list types?
    Dominaezzz

    Dominaezzz

    3 years ago
    Yes but only if you use
    SerialClassDescImpl
    .
    ansman

    ansman

    3 years ago
    Right, any downside to that?
    Dominaezzz

    Dominaezzz

    3 years ago
    None that I know of.
    I got my implementation from the existing List serializers.
    ansman

    ansman

    3 years ago
    Ah, right. It makes sense that they would use a more optimized version