List of utility methods to do File to OutputStream
OutputStream | newOutputStream() new Output Stream return new ByteArrayOutputStream(); |
void | newOutputStream() new Output Stream byteArrayOS = new ByteArrayOutputStream(); dataOS = new DataOutputStream(byteArrayOS); |
OutputStream | newOutputStream(File file) new Output Stream return newFileOutputStream(file);
|
OutputStream | newOutputStream(File file) new Output Stream try { if (!file.exists()) { file.getParentFile().mkdirs(); file.createNewFile(); return new BufferedOutputStream(new FileOutputStream(file)); } catch (IOException e) { throw new RuntimeException(e); ... |
OutputStream | openOutputStream(File file) open Output Stream return new FileOutputStream(file); |
FileOutputStream | openOutputStream(File file) open Output Stream FileOutputStream stream = new FileOutputStream(file); return stream; |
FileOutputStream | openOutputStream(File file) open Output Stream if (file.exists()) { if (file.isDirectory()) { throw new IOException("File '" + file + "' exists but is a directory"); if (!file.canWrite()) { throw new IOException("File '" + file + "' can not be written to"); } else { ... |
FileOutputStream | openOutputStream(File file) Opens a FileOutputStream for the specified file, checking and creating the parent directory if net does not exist. if (file.exists()) { if (file.isDirectory()) { throw new IOException("File '" + file + "' exists but is a directory"); if (file.canWrite() == false) { throw new IOException("File '" + file + "' cannot be written to"); } else { ... |
OutputStream | openOutputStream(File file, boolean append, boolean gzip) open Output Stream if (file.exists()) { if (file.isDirectory()) { throw new IOException("File '" + file + "' exists but is a directory"); if (!file.canWrite()) { throw new IOException("File '" + file + "' cannot be written to"); } else { ... |
OutputStream | openOutputStream(File file, int bufferSize) Opens an OutputStream on a file for writing. return openOutputStream(file, false, bufferSize);
|