catbuf is Ruby's string buffer just for fast appending operation.
Ruby 1.6.x users may get better performance and less memory usage than using String#<<. (In Ruby 1.7.x or later, appending to String is fast enough.) See following benchmark result:
Require "catbuf", and CatBuffer class is provided.
CatBuffer.new(capacity = nil)Creates new string buffer with capacity capacity. (default: 16)
CatBuffer#<<(string)
CatBuffer#append(string)Appends string to buffer.
CatBuffer#stringObtain stored string as String object.
CatBuffer#size
CatBuffer#lengthObtain length of stored string.
CatBuffer#ensure_capacity(capacity)Ensures the buffer capacity length to be more than capacity.
CatBuffer#capacityObtain current buffer capacity length.
This program is free software distributed under BSD-style license term described in file COPYING.
Copyright 2003-, Shirai,Kaoru <shirai@korinkan.co.jp>