byte[] data, boolean xhrCompatible) throws UnableToCompleteException {
TreeLogger logger = getLogger();
// data: URLs are not compatible with XHRs on FF and Safari browsers
if ((!xhrCompatible) && (data.length < MAX_INLINE_SIZE)) {
logger.log(TreeLogger.DEBUG, "Inlining", null);
// This is bad, but I am lazy and don't want to write _another_ encoder
sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
String base64Contents = enc.encode(data).replaceAll("\\s+", "");