public static byte[] toAsciiBytes(long l) {
        // Handle Long.MIN_VALUE specifically, since it breaks all the assumptions
        if (Long.MIN_VALUE == l) {
            return LONG_MIN_VALUE_BYTES;
        }
        int count=1;
        for (long v= l<0 ? -l : l; v >= 10; v=v/10, count++);
        byte [] buf = new byte [count + ((l<0) ? 1 : 0)];
        int offset = 0;
        if (l < 0) {
            buf[offset++] = (byte) '-';
            l = -l;
        }
        for (count--; count >= 0; l=l/10, count--) {
            buf[count+offset] = (byte)(0x30 + l%10);
        }
        return buf;
    }
Encode a long as its decimal representation, i.e. toAsciiBytes(15L) will
return "15" encoded as UTF-8. In other words it is an optimized version
of String.valueOf() followed by UTF-8 encoding. Avoid going through
string in order to get a simple UTF-8 sequence.

@param l
           value to represent as a decimal number encded as utf8
@return byte array
vespajlib/src/main/java/com/yahoo/text/Utf8.java