void AppendBuffer (IntPtr ptr, int count) { if (!(cur_bucket is ByteBucket)) AppendBucket (new ByteBucket ()); total += count; ((ByteBucket) cur_bucket).Write (ptr, count); }