public void writeAscii(long v) {
    if (v == 0) {
      writeByte('0');
      return;
    }

    if (v == Long.MIN_VALUE) {
      writeAscii("-9223372036854775808");
      return;
    }

    if (v < 0) {
      writeByte('-');
      v = -v; // needs to be positive so we can use this for an array index
    }

    writeBackwards(v);
  }
This transcodes a UTF-16 Java String to UTF-8 bytes.

<p>This looks most similar to {@code io.netty.buffer.ByteBufUtil.writeUtf8(AbstractByteBuf,
int, CharSequence, int)} v4.1, modified including features to address ASCII runs of text.
zipkin/src/main/java/zipkin2/internal/WriteBuffer.java