Exemple #1
0
func (c *ColumnCoordinate) ParseField(b iohelper.ByteMultiReader) error {
	table, err := iohelper.ReadVarBytes(b)
	if err != nil {
		return err
	}
	c.Table = table

	row, err := iohelper.ReadVarBytes(b)
	if err != nil {
		return err
	}
	c.Row = row

	family, err := iohelper.ReadVarBytes(b)
	if err != nil {
		return err
	}
	c.Family = family

	qual, err := iohelper.ReadVarBytes(b)
	if err != nil {
		return err
	}
	c.Qual = qual
	return nil
}
Exemple #2
0
func decode(encoded []byte) ([][]byte, error) {
	var ret [][]byte
	buf := bytes.NewBuffer(encoded)
	for {
		b, err := iohelper.ReadVarBytes(buf)
		if len(b) == 0 || (err != nil && err == io.EOF) {
			break
		}
		ret = append(ret, b)
	}
	return ret, nil
}