Skip to content

Instantly share code, notes, and snippets.

@mudge
Created October 1, 2009 09:44
Show Gist options
  • Save mudge/198862 to your computer and use it in GitHub Desktop.
Save mudge/198862 to your computer and use it in GitHub Desktop.
Some JRuby to write an InputStream to a file.
# Write a Java stream to a file.
File.open('test.txt', 'w') do |f|
while (byte = stream.read) > -1
f << byte.chr
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment