integers.go
func (b *TupleBuilder) PutUint8(field string, value uint8) (wrote uint64, err error) {

	// field type should be a Uint8Field
	if err = b.typeCheck(field, Uint8Field); err != nil {
		return 0, err
	}

	// minimum bytes is 2 (type code + value)
	if b.available() < 2 {
		return 0, xbinary.ErrOutOfRange
	}

	// write type code
	b.buffer[b.pos] = byte(UnsignedInt8Code.OpCode)

	// write value
	b.buffer[b.pos+1] = byte(value)

	// set field offset
	b.offsets[field] = b.pos

	// incr pos
	b.pos += 2

	return 2, nil
}
func (b *TupleBuilder) PutUint8(field string, value uint8) (wrote uint64, err error) {

	// field type should be a Uint8Field
	if err = b.typeCheck(field, Uint8Field); err != nil {
		return 0, err
	}

	// minimum bytes is 2 (type code + value)
	if b.available() < 2 {
		return 0, xbinary.ErrOutOfRange
	}

	// write type code
	b.buffer[b.pos] = byte(UnsignedInt8Code.OpCode)

	// write value
	b.buffer[b.pos+1] = byte(value)

	// set field offset
	b.offsets[field] = b.pos

	// incr pos
	b.pos += 2

	return 2, nil
}
// PutUint8 sets an 8-bit unsigned value for the given string name. The field name must be a Uint8Field otherwise an error will be returned. If the type buffer no longer has enough space to write this value an xbinary.ErrOutOfRange error will be returned. Upon success 2 bytes should be written into the buffer and the returned error should be nil. The type code is written first then the byte value.