(pe packetEncoder, version int16)
| 20 | } |
| 21 | |
| 22 | func (b *offsetCommitRequestBlock) encode(pe packetEncoder, version int16) error { |
| 23 | pe.putInt64(b.offset) |
| 24 | if version == 1 { |
| 25 | pe.putInt64(b.timestamp) |
| 26 | } else if b.timestamp != 0 { |
| 27 | Logger.Println("Non-zero timestamp specified for OffsetCommitRequest not v1, it will be ignored") |
| 28 | } |
| 29 | if version >= 6 { |
| 30 | pe.putInt32(b.committedLeaderEpoch) |
| 31 | } |
| 32 | |
| 33 | if err := pe.putString(b.metadata); err != nil { |
| 34 | return err |
| 35 | } |
| 36 | pe.putEmptyTaggedFieldArray() |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | func (b *offsetCommitRequestBlock) decode(pd packetDecoder, version int16) (err error) { |
| 41 | if b.offset, err = pd.getInt64(); err != nil { |
nothing calls this directly
no test coverage detected