public int writeList(List<Span> spans, byte[] out, int pos) {
    int lengthOfSpans = spans.size();
    if (lengthOfSpans == 0) return 0;

    WriteBuffer result = WriteBuffer.wrap(out, pos);
    ThriftCodec.writeList(this, spans, result);

    return result.pos() - pos;
  }
This type isn't thread-safe: it re-uses state to avoid re-allocations in conversion loops.
zipkin/src/main/java/zipkin2/internal/V1ThriftSpanWriter.java