rb: Buffer the slice!s in MemoryBuffer for a significant performance increase [THRIFT-63]

Author: Kevin Ballard <kevin@rapleaf.com>

Currently it buffers up to 4kB before throwing away the data.
Tests with 1MB shows the exact same performance characteristics.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675049 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/transport_spec.rb b/lib/rb/spec/transport_spec.rb
index 1fe8600..972e984 100644
--- a/lib/rb/spec/transport_spec.rb
+++ b/lib/rb/spec/transport_spec.rb
@@ -240,7 +240,8 @@
       s = "this is a test"
       @buffer = MemoryBuffer.new(s)
       @buffer.read(4).should == "this"
-      s.should == " is a test"
+      s.slice!(-4..-1)
+      @buffer.read(@buffer.available).should == " is a "
     end
 
     it "should always remain open" do