240 DBG(cerr <<
"In chunked_outbuf::xsputn: num: " << num << endl);
250 int32_t bytes_in_buffer = pptr() - pbase();
256 DBG2(cerr <<
":xsputn: buffering num: " << num << endl);
257 memcpy(pptr(), s, num);
259 return traits_type::not_eof(num);
271 header = htonl(header);
273 d_os.write((
const char *)&header,
sizeof(int32_t));
282 return traits_type::not_eof(0);
284 int bytes_to_fill_out_buffer =
d_buf_size - bytes_in_buffer;
285 d_os.write(s, bytes_to_fill_out_buffer);
287 return traits_type::not_eof(0);
288 s += bytes_to_fill_out_buffer;
289 uint32_t bytes_still_to_send = num - bytes_to_fill_out_buffer;
295 d_os.write((
const char *)&header,
sizeof(int32_t));
298 return traits_type::not_eof(0);
303 if (bytes_still_to_send > 0) {
307 memcpy(
d_buffer, s, bytes_still_to_send);
308 pbump(bytes_still_to_send);
313 return traits_type::not_eof(num);