Java Utililty Methods BufferedInputStream Copy

List of utility methods to do BufferedInputStream Copy

Description

The list of methods to do BufferedInputStream Copy are organized into topic(s).

Method

voidcopyFile(final File source, final File dest, final boolean overwrite)
copy File
if (dest.exists()) {
    if (overwrite)
        dest.delete();
    else
        return;
if (!dest.getParentFile().exists())
    dest.getParentFile().mkdirs();
...
voidcopyFile(final File source, final File destination)
Copy the source file to the destination file.
if (source == null) {
    throw new NullPointerException("Source is null");
if (destination == null) {
    throw new NullPointerException("Destination is null");
if (source.exists() == false) {
    throw new NullPointerException("Source file not found.");
...
voidcopyFile(final File source, final File destination, final boolean overwrite)
copy File
if (source == null) {
    throw new NullPointerException("source");
if (!source.exists()) {
    throw new IllegalArgumentException("source");
if (!source.canRead()) {
    throw new IllegalArgumentException("source");
...
voidcopyFile(final File sourceFile, final File targetFile)
Copy file
BufferedInputStream inBuff = null;
BufferedOutputStream outBuff = null;
FileInputStream input = null;
FileOutputStream output = null;
try {
    input = new FileInputStream(sourceFile);
    inBuff = new BufferedInputStream(input);
    output = new FileOutputStream(targetFile);
...
voidcopyFile(final File src, final File dest)
copy File
final InputStream in = new BufferedInputStream(new FileInputStream(src));
try {
    copyFile(in, dest);
} finally {
    close(in);
voidcopyFile(final File to, final File from)
Copy the contents of a file.
BufferedInputStream reader = new BufferedInputStream(new FileInputStream(from));
BufferedOutputStream writer = new BufferedOutputStream(new FileOutputStream(to));
copyStream(writer, reader);
writer.close();
reader.close();
booleancopyFile(InputStream is, File newFile)
Copia de um ImputStream para um Arquivo a ser criado no caminho pathFileDestign
FileOutputStream out = new FileOutputStream(newFile);
BufferedInputStream inBuffer = new BufferedInputStream(is);
BufferedOutputStream outBuffer = new BufferedOutputStream(out);
int theByte = 0;
while ((theByte = inBuffer.read()) > -1) {
    outBuffer.write(theByte);
outBuffer.close();
...
booleancopyFile(InputStream src, File dest)
Copy inputStream into the specified file.
ensureOrCreatePathAndFile(dest);
return copyStream(src, new FileOutputStream(dest));
voidcopyFile(InputStream src, File dst)
copy File
int BUFFER_SIZE = 16 * 1024;
try {
    InputStream in = null;
    OutputStream out = null;
    try {
        in = new BufferedInputStream(src, BUFFER_SIZE);
        out = new BufferedOutputStream(new FileOutputStream(dst), BUFFER_SIZE);
        byte[] buffer = new byte[BUFFER_SIZE];
...
voidcopyFile(String dest_path, String src_path)
copy File
if (dest_path == null)
    return;
try {
    File f1 = new File(dest_path);
    File f2 = new File(src_path);
    if (f1.getCanonicalPath().equals(f2.getCanonicalPath())) {
        System.err.println("FormsDesignerUtils.copyFile  dest and src are same.");
        return;
...