in src/main/java/org/apache/sling/nosql/generic/resource/impl/NoSqlValueMap.java [102:120]
private static Object convertForWrite(Object value) {
if (value instanceof Date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime((Date)value);
value = calendar;
}
else if (value instanceof InputStream) {
// Store InputStream values as byte array
try {
value = convertForWrite(IOUtils.toByteArray((InputStream)value));
} catch (IOException ex) {
throw new RuntimeException("Unable to convert input stream to byte array.");
}
}
else if (value != null && !isValidType(value.getClass())) {
throw new IllegalArgumentException("Data type not supported for NoSqlValueMap: " + value.getClass());
}
return value;
}