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

Method WriteLength

thrift/binary.go:278–286  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

276}
277
278func (w *binaryWriter) WriteLength(n int) error {
279 if n < 0 {
280 return fmt.Errorf("negative length cannot be encoded in thrift: %d", n)
281 }
282 if n > math.MaxInt32 {
283 return fmt.Errorf("length is too large to be encoded in thrift: %d", n)
284 }
285 return w.WriteInt32(int32(n))
286}
287
288func (w *binaryWriter) WriteMessage(m Message) error {
289 if w.p.NonStrict {

Callers 2

WriteBytesMethod · 0.95
WriteStringMethod · 0.95

Calls 1

WriteInt32Method · 0.95

Tested by

no test coverage detected