public void writeBool(boolean value) {
        int minCapacity = off + 5;
        byte[] bytes = this.bytes;
        if (minCapacity > bytes.length) {
            bytes = grow(minCapacity);
        }
        int off = this.off;
        if ((context.features & MASK_WRITE_BOOLEAN_AS_NUMBER) != 0) {
            bytes[off++] = (byte) (value ? '1' : '0');
        } else {
            off = IOUtils.putBoolean(bytes, off, value);
        }
        this.off = off;
    }
A faster alternative that is functionally equivalent to Long.expand(i, 0x0F0F_0F0F_0F0F_0F0FL)
core/src/main/java/com/alibaba/fastjson2/JSONWriterUTF8.java