当前位置: 首页>>代码示例>>Golang>>正文


Golang Reader.ReadUint16方法代码示例

本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Reader.ReadUint16方法的典型用法代码示例。如果您正苦于以下问题:Golang Reader.ReadUint16方法的具体用法?Golang Reader.ReadUint16怎么用?Golang Reader.ReadUint16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/tinylib/msgp/msgp.Reader的用法示例。


在下文中一共展示了Reader.ReadUint16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: DecodeMsg

// DecodeMsg implements msgp.Decodable
func (z *interval16) DecodeMsg(dc *msgp.Reader) (err error) {
	var field []byte
	_ = field
	var zeff uint32
	zeff, err = dc.ReadMapHeader()
	if err != nil {
		return
	}
	for zeff > 0 {
		zeff--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "start":
			z.start, err = dc.ReadUint16()
			if err != nil {
				return
			}
		case "last":
			z.last, err = dc.ReadUint16()
			if err != nil {
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				return
			}
		}
	}
	return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:35,代码来源:rle16_gen.go

示例2: DecodeMsg

// DecodeMsg implements msgp.Decodable
func (z *arrayContainer) DecodeMsg(dc *msgp.Reader) (err error) {
	var field []byte
	_ = field
	var zbzg uint32
	zbzg, err = dc.ReadMapHeader()
	if err != nil {
		return
	}
	for zbzg > 0 {
		zbzg--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "content":
			var zbai uint32
			zbai, err = dc.ReadArrayHeader()
			if err != nil {
				return
			}
			if cap(z.content) >= int(zbai) {
				z.content = (z.content)[:zbai]
			} else {
				z.content = make([]uint16, zbai)
			}
			for zxvk := range z.content {
				z.content[zxvk], err = dc.ReadUint16()
				if err != nil {
					return
				}
			}
		default:
			err = dc.Skip()
			if err != nil {
				return
			}
		}
	}
	return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:42,代码来源:arraycontainer_gen.go

示例3: DecodeMsg

// DecodeMsg implements msgp.Decodable
func (z *roaringArray) DecodeMsg(dc *msgp.Reader) (err error) {
	var field []byte
	_ = field
	var zlqf uint32
	zlqf, err = dc.ReadMapHeader()
	if err != nil {
		return
	}
	for zlqf > 0 {
		zlqf--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "keys":
			var zdaf uint32
			zdaf, err = dc.ReadArrayHeader()
			if err != nil {
				return
			}
			if cap(z.keys) >= int(zdaf) {
				z.keys = (z.keys)[:zdaf]
			} else {
				z.keys = make([]uint16, zdaf)
			}
			for zhct := range z.keys {
				z.keys[zhct], err = dc.ReadUint16()
				if err != nil {
					return
				}
			}
		case "needCopyOnWrite":
			var zpks uint32
			zpks, err = dc.ReadArrayHeader()
			if err != nil {
				return
			}
			if cap(z.needCopyOnWrite) >= int(zpks) {
				z.needCopyOnWrite = (z.needCopyOnWrite)[:zpks]
			} else {
				z.needCopyOnWrite = make([]bool, zpks)
			}
			for zcua := range z.needCopyOnWrite {
				z.needCopyOnWrite[zcua], err = dc.ReadBool()
				if err != nil {
					return
				}
			}
		case "copyOnWrite":
			z.copyOnWrite, err = dc.ReadBool()
			if err != nil {
				return
			}
		case "conserz":
			var zjfb uint32
			zjfb, err = dc.ReadArrayHeader()
			if err != nil {
				return
			}
			if cap(z.conserz) >= int(zjfb) {
				z.conserz = (z.conserz)[:zjfb]
			} else {
				z.conserz = make([]containerSerz, zjfb)
			}
			for zxhx := range z.conserz {
				var zcxo uint32
				zcxo, err = dc.ReadMapHeader()
				if err != nil {
					return
				}
				for zcxo > 0 {
					zcxo--
					field, err = dc.ReadMapKeyPtr()
					if err != nil {
						return
					}
					switch msgp.UnsafeString(field) {
					case "t":
						{
							var zeff uint8
							zeff, err = dc.ReadUint8()
							z.conserz[zxhx].t = contype(zeff)
						}
						if err != nil {
							return
						}
					case "r":
						err = z.conserz[zxhx].r.DecodeMsg(dc)
						if err != nil {
							return
						}
					default:
						err = dc.Skip()
						if err != nil {
							return
						}
					}
				}
//.........这里部分代码省略.........
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:101,代码来源:roaringarray_gen.go


注:本文中的github.com/tinylib/msgp/msgp.Reader.ReadUint16方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。