Lines Matching refs:buf
22 StreamBuffer::StreamBuffer(const StreamBuffer &buf)
24 Clone(buf);
64 bool StreamBuffer::Write(const std::string &buf)
66 return Write(buf.c_str(), buf.length() + 1);
69 bool StreamBuffer::Read(std::string &buf)
76 buf = ReadBuf();
77 rPos_ = rPos_ + static_cast<int32_t>(buf.length()) + 1;
78 return (buf.length() > 0);
81 bool StreamBuffer::Write(const StreamBuffer &buf)
83 return Write(buf.Data(), buf.Size());
86 bool StreamBuffer::Read(StreamBuffer &buf)
88 return buf.Write(Data(), Size());
91 bool StreamBuffer::Read(char *buf, size_t size)
97 if (buf == nullptr) {
98 FI_HILOGE("Invalid input parameter buf:nullptr, errCode:%{public}d", PARAM_INPUT_INVALID);
112 errno_t ret = memcpy_sp(buf, size, ReadBuf(), size);
124 bool StreamBuffer::Write(const char *buf, size_t size)
130 if (buf == nullptr) {
131 FI_HILOGE("Invalid input parameter, buf:nullptr, errCode:%{public}d", PARAM_INPUT_INVALID);
146 errno_t ret = memcpy_sp(&szBuff_[wPos_], GetAvailableBufSize(), buf, size);
208 bool StreamBuffer::Clone(const StreamBuffer &buf)
211 return Write(buf.Data(), buf.Size());