SocketRBuffer::SocketRBuffer(int fd_value, size_t buffer_size_value) : RBuffer(buffer_size_value) , fd(fd_value) , closed_(false) { ReadMore(); }
SocketRBuffer::SocketRBuffer(size_t buf_size, int fd) : RBuffer(buf_size) , fd_(fd) , closed_(false) { ReadMore(); }
char SocketRBuffer::ReadChar() { if (pos_ == end_) { ReadMore(); } return buffer_[pos_++]; }
StringRBuffer::StringRBuffer(size_t buf_size, const std::string& s) : RBuffer(buf_size) , string_(s) , string_iter_(string_.begin()) { ReadMore(); }