String fileSeparator = System.getProperty("file.separator");
final File outFile = new File(currentDir + fileSeparator + "pic_thumb.jpg");
outFile.createNewFile();
final byte[] originalImage = IOUtils.toByteArray(in);
final byte[] resizedData = new Katto().setOriginalData(originalImage).setQuality(1f).setTargetWidth(400).resize();
FileOutputStream fos = new FileOutputStream(outFile);
IOUtils.write(resizedData, fos);
System.out.println(currentDir + fileSeparator + "pic_thumb.jpg");
}