+func (b *Buffer) EncodeInt8(v int8) {
+ b.buf[b.pos] = byte(v)
+ b.pos += 1
+}
+
+func (b *Buffer) DecodeInt8() int8 {
+ v := int8(b.buf[b.pos])
+ b.pos += 1
+ return v
+}
+
+func (b *Buffer) EncodeInt16(v int16) {
+ binary.BigEndian.PutUint16(b.buf[b.pos:b.pos+2], uint16(v))
+ b.pos += 2
+}
+
+func (b *Buffer) DecodeInt16() int16 {
+ v := int16(binary.BigEndian.Uint16(b.buf[b.pos : b.pos+2]))
+ b.pos += 2
+ return v
+}
+
+func (b *Buffer) EncodeInt32(v int32) {
+ binary.BigEndian.PutUint32(b.buf[b.pos:b.pos+4], uint32(v))
+ b.pos += 4
+}
+
+func (b *Buffer) DecodeInt32() int32 {
+ v := int32(binary.BigEndian.Uint32(b.buf[b.pos : b.pos+4]))
+ b.pos += 4
+ return v
+}
+
+func (b *Buffer) EncodeInt64(v int64) {
+ binary.BigEndian.PutUint64(b.buf[b.pos:b.pos+8], uint64(v))
+ b.pos += 8
+}
+
+func (b *Buffer) DecodeInt64() int64 {
+ v := int64(binary.BigEndian.Uint64(b.buf[b.pos : b.pos+8]))
+ b.pos += 8
+ return v
+}
+