Trying to get the aerospike ruby client to work under 1.8
What is the equivalent of these calls in ruby 1.8 ?
https://github.com/aerospike/aerospike-client-ruby/blob/master/lib/aerospike/utils/buffer.rb#L65
https://github.com/aerospike/aerospike-client-ruby/blob/master/lib/aerospike/utils/buffer.rb#L95
Rather than rely on how a particular version of Ruby processes bytes/chars/strings, instead use the
pack
andunpack
methods. They are always available and behave consistently.For your use,
unpack
the data into an array, then you can use normal Array slicing to change the bytes in question, thenpack
everything back into the byte-stream.