static int sizeInBytes(int valueSizeInBytes, int endpointSizeInBytes) {
      int sizeInBytes = 0;
      sizeInBytes += 3 + 8; // TIMESTAMP
      sizeInBytes += 3 + 4 + valueSizeInBytes;
      if (endpointSizeInBytes > 0) sizeInBytes += 3 + endpointSizeInBytes;
      sizeInBytes++; // TYPE_STOP
      return sizeInBytes;
    }
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