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

    byte[] result = new byte[ThriftCodec.listSizeInBytes(this, spans)];
    ThriftCodec.writeList(this, spans, WriteBuffer.wrap(result));
    return result;
  }
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