Skip to content

Instantly share code, notes, and snippets.

@idletekz
Forked from osima/fileCopy.groovy
Created April 19, 2017 13:19
Show Gist options
  • Save idletekz/72a871ae140fcd0a62974f4453d586d0 to your computer and use it in GitHub Desktop.
Save idletekz/72a871ae140fcd0a62974f4453d586d0 to your computer and use it in GitHub Desktop.
binary file copy example in groovy
copy = { File src,File dest->
def input = src.newDataInputStream()
def output = dest.newDataOutputStream()
output << input
input.close()
output.close()
}
//File srcFile = new File(args[0])
//File destFile = new File(args[1])
File srcFile = new File('src.png')
File destFile = new File('dest.png')
copy(srcFile,destFile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment