Created
October 1, 2009 09:44
-
-
Save mudge/198862 to your computer and use it in GitHub Desktop.
Some JRuby to write an InputStream to a file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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