+ if (b64 == null || b64) {
+ try {
+ String zipped = StringUtils.base64(out.toString(), zip);
+ if (b64 != null || zipped.length() < out.length() - 4) {
+ SerialUtils.write(out, zip ? "ZIP:" : "B64:");
+ SerialUtils.write(out, zipped);
+ return;
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(
+ "Base64 conversion of data failed, maybe not enough memory?",
+ e);
+ }