fewer allocations building byte array encodings