private void createFile(byte[] stream, String filename) throws FileNotFoundException, IOException { File aFile = new File(tempFolder, this.getClass().getSimpleName() + "_" + filename); FileOutputStream fos = new FileOutputStream(aFile); IOUtils.write(stream, fos); fos.close(); }
public InputStream getInputStream() throws IOException { ByteArrayOutputStream o = new ByteArrayOutputStream(); IOUtils.write(super.toCharArray(), o, charset.name()); return new ByteArrayInputStream(o.toByteArray()); }