import java.util.Map;
import java.util.UnknownFormatConversionException;
-import be.nikiroo.utils.StringUtils;
+import be.nikiroo.utils.ImageUtils;
/**
* Small class to help with serialisation.
@Override
protected String toString(Object value) {
try {
- return StringUtils.fromImage((BufferedImage) value);
+ return ImageUtils.toBase64((BufferedImage) value);
} catch (IOException e) {
throw new UnknownFormatConversionException(e.getMessage());
}
@Override
protected Object fromString(String content) {
try {
- return StringUtils.toImage(content);
+ return ImageUtils.fromBase64(content);
} catch (IOException e) {
throw new UnknownFormatConversionException(e.getMessage());
}
String type = CustomSerializer.typeOf(encodedValue);
if (customTypes.containsKey(type)) {
return customTypes.get(type).decode(encodedValue);
- } else {
- throw new UnknownFormatConversionException(
- "Unknown custom type: " + type);
}
+ throw new UnknownFormatConversionException("Unknown custom type: "
+ + type);
} else if (encodedValue.equals("NULL") || encodedValue.equals("null")) {
return null;
} else if (encodedValue.endsWith("\"")) {