code: private static SpanId longToSpanId(long x) {
      ByteBuffer buffer = ByteBuffer.allocate(SpanId.SIZE);
      buffer.putLong(x);
      return SpanId.fromBytes(buffer.array());
    }
docs: Using big-endian encoding.