MCPcopy Create free account
hub / github.com/apache/thrift / WriteString

Method WriteString

lib/go/thrift/compact_protocol.go:334–344  ·  view source on GitHub ↗

Write a string to the wire with a varint size preceding.

(ctx context.Context, value string)

Source from the content-addressed store, hash-verified

332
333// Write a string to the wire with a varint size preceding.
334func (p *TCompactProtocol) WriteString(ctx context.Context, value string) error {
335 _, e := p.writeVarint32(int32(len(value)))
336 if e != nil {
337 return NewTProtocolException(e)
338 }
339 if len(value) == 0 {
340 return nil
341 }
342 _, e = p.trans.WriteString(value)
343 return e
344}
345
346// Write a byte array, using a varint for the size.
347func (p *TCompactProtocol) WriteBinary(ctx context.Context, bin []byte) error {

Callers 2

FlushMethod · 0.95
WriteMessageBeginMethod · 0.95

Calls 3

writeVarint32Method · 0.95
NewTProtocolExceptionFunction · 0.85
WriteStringMethod · 0.65

Tested by

no test coverage detected