Permalink
Browse files

Use read_* and write_* methods when offset is always 0.

  • Loading branch information...
postmodern committed Sep 22, 2012
1 parent 13646ec commit 6c315255b5e79f30798c04ccf64235f198b1729f
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/ffi/msgpack/msg_object.rb
  2. +1 −1 lib/ffi/msgpack/msg_raw.rb
  3. +1 −1 lib/ffi/msgpack/packer.rb
  4. +1 −1 spec/msg_object_spec.rb
@@ -259,7 +259,7 @@ def set_raw!(value)
@objects = nil
@memory = FFI::MemoryPointer.new(:uchar, value.length)
- @memory.put_bytes(0,value)
+ @memory.write_bytes(value)
self[:type] = :raw
@@ -34,7 +34,7 @@ def raw
# The raw data.
#
def to_s
- self[:ptr].get_bytes(0,self[:size])
+ self[:ptr].read_bytes(self[:size])
end
end
@@ -100,7 +100,7 @@ def callback(&block)
self[:callback] = Proc.new do |data_ptr,packed_buffer,length|
@total += length
- packed = packed_buffer.get_bytes(0,length)
+ packed = packed_buffer.read_bytes(length)
if block.arity == 2
block.call(packed,length)
View
@@ -204,7 +204,7 @@
key[:type].should == :raw
raw = key[:values][:raw]
- raw[:ptr].get_bytes(0,raw[:size]).should == 'one'
+ raw[:ptr].read_bytes(raw[:size]).should == 'one'
value = pair[:value]
value[:type].should == :map

0 comments on commit 6c31525

Please sign in to comment.