Skip to content

Instantly share code, notes, and snippets.

@blinsay
Created October 29, 2014 23:41
[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