Sha256: 5aab25002feb175a9b04793dcfa8bf4f22dd0728c7d457d8c6f930cae56d6873

Contents?: true

Size: 445 Bytes

Versions: 43

Compression:

Stored size: 445 Bytes

Contents

module Beefcake
  class Buffer
    
    def initialize(buf="")
      if buf.respond_to?(:force_encoding)
        self.buf = buf.force_encoding("BINARY")
      else
        self.buf = buf
      end
    end

    def append_string(s)
      append_uint64(s.length)
      if s.respond_to?(:force_encoding)
        self << s.force_encoding("BINARY")
      else
        self << s
      end
    end
    alias :append_bytes :append_string
    
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
riemann-babbler-1.0.7.9 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.8 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.7 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.5 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.4 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.1.0pre2 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.3 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.2 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7.1 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.7 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.6 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.7 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.6 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.5 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.4 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.3 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.2 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5.1 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.5 lib/riemann/babbler/support/monkey_patches.rb
riemann-babbler-1.0.4 lib/riemann/babbler/support/monkey_patches.rb