return new ClobType(clob);
}
public static Blob toBytes(ClobType value, String encoding) throws IOException {
Charset cs = getCharset(encoding);
ClobInputStreamFactory cisf = new ClobInputStreamFactory(value.getReference());
cisf.setCharset(cs);
if (CharsetUtils.BASE64_NAME.equalsIgnoreCase(encoding) || CharsetUtils.HEX_NAME.equalsIgnoreCase(encoding)) {
//validate that the binary conversion is possible
//TODO: cache the result in a filestore
InputStream is = cisf.getInputStream();
try {
while (is.read() != -1) {
}
} finally {