コード例 #1
0
 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();
 }
コード例 #2
0
 public InputStream getInputStream() throws IOException {
   ByteArrayOutputStream o = new ByteArrayOutputStream();
   IOUtils.write(super.toCharArray(), o, charset.name());
   return new ByteArrayInputStream(o.toByteArray());
 }