Guest User

Untitled

a guest
Oct 16th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.37 KB | None | 0 0
  1. misutowolf@blomkvist:~/Projects/freeman/lib$ irb -I .
  2. 2.0.0-p247 :001 > load 'source_buffer.rb'
  3.  => true
  4. 2.0.0-p247 :002 > buf = SourceBuffer.new
  5.  => #<SourceBuffer:0x00000002ba6d80>
  6. 2.0.0-p247 :003 > buf.set("Hello\0World\0")
  7.  => 0
  8. 2.0.0-p247 :004 > buf.get_string
  9.  => ""
  10. 2.0.0-p247 :005 > buf.get_string
  11.  => ""
  12. 2.0.0-p247 :006 > buf.buffer
  13.  => "Hello\x00World\x00"
Advertisement
Add Comment
Please, Sign In to add comment