MCPcopy Index your code
hub / github.com/CodisLabs/codis / WriteByte

Method WriteByte

pkg/utils/bufio2/bufio.go:247–257  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

245}
246
247func (b *Writer) WriteByte(c byte) error {
248 if b.err != nil {
249 return b.err
250 }
251 if b.available() == 0 && b.flush() != nil {
252 return b.err
253 }
254 b.buf[b.wpos] = c
255 b.wpos += 1
256 return nil
257}
258
259func (b *Writer) WriteString(s string) (nn int, err error) {
260 for b.err == nil && len(s) > b.available() {

Callers 3

TestWriteBytesFunction · 0.80
encodeRespMethod · 0.80
encodeMultiBulkMethod · 0.80

Calls 2

availableMethod · 0.95
flushMethod · 0.95

Tested by 1

TestWriteBytesFunction · 0.64