MCPcopy
hub / github.com/segmentio/kafka-go / writeCompactNullString

Method writeCompactNullString

protocol/encode.go:267–274  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

265}
266
267func (e *encoder) writeCompactNullString(s string) {
268 if s == "" {
269 e.writeUnsignedVarInt(0)
270 } else {
271 e.writeUnsignedVarInt(uint64(len(s)) + 1)
272 e.WriteString(s)
273 }
274}
275
276func (e *encoder) writeBytes(b []byte) {
277 e.writeInt32(int32(len(b)))

Callers 1

Calls 2

writeUnsignedVarIntMethod · 0.95
WriteStringMethod · 0.95

Tested by

no test coverage detected