MCPcopy Create free account
hub / github.com/segmentio/encoding / WriteLength

Method WriteLength

thrift/compact.go:281–289  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

279}
280
281func (w *compactWriter) WriteLength(n int) error {
282 if n < 0 {
283 return fmt.Errorf("negative length cannot be encoded in thrift: %d", n)
284 }
285 if n > math.MaxInt32 {
286 return fmt.Errorf("length is too large to be encoded in thrift: %d", n)
287 }
288 return w.writeUvarint(uint64(n))
289}
290
291func (w *compactWriter) WriteMessage(m Message) error {
292 if err := w.binary.writeByte(0x82); err != nil {

Callers 2

WriteBytesMethod · 0.95
WriteStringMethod · 0.95

Calls 1

writeUvarintMethod · 0.95

Tested by

no test coverage detected