-
-
Save blinsay/9a5ea651aeebd6375fd0 to your computer and use it in GitHub Desktop.
This file contains 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
[16] pry(main)> def write_bytes_to_stream(thing) | |
[16] pry(main)* bs = ByteArrayOutputStream.new(1024) | |
[16] pry(main)* bs.java_send :write, [Java::int], thing | |
[16] pry(main)* bs.close | |
[16] pry(main)* bs.to_byte_array | |
[16] pry(main)* end | |
=> nil | |
[20] pry(main)> write_bytes_to_stream(1024) | |
=> byte[0]@6ad3381f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment