You shouldn't use Readers and Writers if you're expecting binary data...
Try replacing:
output.withWriter { writer ->
writer << new URL(url).openStream()
}
With
new URL( url ).withInputStream { uin ->
uin.eachByte( 4096 ) { buffer, nBytes ->
output.write( buffer, 0, nBytes )
}
}