docs: public static boolean writeStream(File file, InputStream stream, boolean append) throws IOException {
          OutputStream o = null;
          try {
              makeDirs(file.getAbsolutePath());
              o = new FileOutputStream(file, append);
              byte data[] = new byte[1024];
              int length = -1;
              while ((length = stream.read(data)) != -1) {
                  o.write(data, 0, length);
              }
              o.flush();
              return true;
          } finally {
              closeQuietly(o);
              closeQuietly(stream);
          }
      }