@Override
    public void read(AlternateSpanList altSpanList) {
        byte type = buf.get();
        if (type != AlternateSpanList.ID) {
            throw new DeserializationException("Cannot deserialize AlternateSpanList with type " + type);
        }
        int numSubTrees = buf.getInt1_2_4Bytes();

        for (int i = 0; i < numSubTrees; i++) {
            double prob = buf.getDouble();
            List<SpanNode> list = readSpanList();

            if (i == 0) {
                for (SpanNode node : list) {
                    altSpanList.add(node);
                }
                altSpanList.setProbability(0, prob);
            } else {
                altSpanList.addChildren(i, list, prob);
            }
        }
    }
Class used for de-serializing documents on the Vespa 6.x document format.

@author baldersheim
document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java