Base64Variant b64variant = sBase64Variants[bv];
for (int i = 0; i < LEN_ATTR.length; ++i) {
int size = LEN_ATTR[i];
byte[] data = generateData(new Random(size), size);
char[] buffer = new char[4 + (data.length * 3 / 2)];
AsciiValueEncoder enc = new ValueEncoderFactory().getEncoder(b64variant, data, 0, data.length);
int len = enc.encodeMore(buffer, 0, buffer.length);
StringBuilder sb = new StringBuilder(buffer.length + 32);
sb.append("<root attr='");
sb.append(buffer, 0, len);
sb.append("' />");