InputSteam to OutputStream


InputStream in = node.getProperty("jcr:data").getStream();
ByteArrayOutputStream out = new ByteArrayOutputStream(500 * 1024);
makeThumbnail(in, out);
out.flush();
node.setProperty("dms:Thumbnail", new ByteArrayInputStream(out
.toByteArray()));
node.save();

你可能感兴趣的:(OutputStream)