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

Method WriteField

thrift/compact.go:304–315  ·  view source on GitHub ↗
(f Field)

Source from the content-addressed store, hash-verified

302}
303
304func (w *compactWriter) WriteField(f Field) error {
305 if f.Type == STOP {
306 return w.binary.writeByte(0)
307 }
308 if f.ID <= 15 {
309 return w.binary.writeByte(byte(f.ID<<4) | byte(f.Type))
310 }
311 if err := w.binary.writeByte(byte(f.Type)); err != nil {
312 return err
313 }
314 return w.WriteInt16(f.ID)
315}
316
317func (w *compactWriter) WriteList(l List) error {
318 if l.Size <= 14 {

Callers

nothing calls this directly

Calls 2

WriteInt16Method · 0.95
writeByteMethod · 0.80

Tested by

no test coverage detected