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


Golang Reader.ReadUint16方法代码示例

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


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

示例1: DecodeXDRFrom

func (o *TestStruct) DecodeXDRFrom(xr *xdr.Reader) error {
	o.I = int(xr.ReadUint64())
	o.I8 = int8(xr.ReadUint8())
	o.UI8 = xr.ReadUint8()
	o.I16 = int16(xr.ReadUint16())
	o.UI16 = xr.ReadUint16()
	o.I32 = int32(xr.ReadUint32())
	o.UI32 = xr.ReadUint32()
	o.I64 = int64(xr.ReadUint64())
	o.UI64 = xr.ReadUint64()
	o.BS = xr.ReadBytesMax(1024)
	o.S = xr.ReadStringMax(1024)
	(&o.C).DecodeXDRFrom(xr)
	_SSSize := int(xr.ReadUint32())
	if _SSSize < 0 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	}
	if _SSSize > 1024 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	}
	o.SS = make([]string, _SSSize)
	for i := range o.SS {
		o.SS[i] = xr.ReadString()
	}
	return xr.Error()
}
开发者ID:kattunga,项目名称:syncthing,代码行数:26,代码来源:encdec_xdr_test.go

示例2: DecodeXDRFrom

func (o *SessionInvitation) DecodeXDRFrom(xr *xdr.Reader) error {
	o.From = xr.ReadBytesMax(32)
	o.Key = xr.ReadBytesMax(32)
	o.Address = xr.ReadBytesMax(32)
	o.Port = xr.ReadUint16()
	o.ServerSocket = xr.ReadBool()
	return xr.Error()
}
开发者ID:readthecodes,项目名称:syncthing,代码行数:8,代码来源:packets_xdr.go

示例3: DecodeXDRFrom

func (o *XDRBenchStruct) DecodeXDRFrom(xr *xdr.Reader) error {
	o.I1 = xr.ReadUint64()
	o.I2 = xr.ReadUint32()
	o.I3 = xr.ReadUint16()
	o.I4 = xr.ReadUint8()
	o.Bs0 = xr.ReadBytesMax(128)
	o.Bs1 = xr.ReadBytes()
	o.S0 = xr.ReadStringMax(128)
	o.S1 = xr.ReadString()
	return xr.Error()
}
开发者ID:kattunga,项目名称:syncthing,代码行数:11,代码来源:bench_xdr_test.go

示例4: decodeXDR

func (o *TestStruct) decodeXDR(xr *xdr.Reader) error {
	o.I = int(xr.ReadUint64())
	o.I8 = int8(xr.ReadUint8())
	o.UI8 = xr.ReadUint8()
	o.I16 = int16(xr.ReadUint16())
	o.UI16 = xr.ReadUint16()
	o.I32 = int32(xr.ReadUint32())
	o.UI32 = xr.ReadUint32()
	o.I64 = int64(xr.ReadUint64())
	o.UI64 = xr.ReadUint64()
	o.BS = xr.ReadBytes()
	o.S = xr.ReadString()
	(&o.C).decodeXDR(xr)
	return xr.Error()
}
开发者ID:Blueprint-Marketing,项目名称:syncthing,代码行数:15,代码来源:encdec_xdr_test.go

示例5: decodeXDR

func (o *Address) decodeXDR(xr *xdr.Reader) error {
	o.IP = xr.ReadBytesMax(16)
	o.Port = xr.ReadUint16()
	return xr.Error()
}
开发者ID:baa-archieve,项目名称:syncthing,代码行数:5,代码来源:packets_xdr.go

示例6: decodeXDR

func (o *address) decodeXDR(xr *xdr.Reader) error {
	o.ip = xr.ReadBytes()
	o.port = xr.ReadUint16()
	o.seen = int64(xr.ReadUint64())
	return xr.Error()
}
开发者ID:mapleshadow,项目名称:discosrv,代码行数:6,代码来源:types_xdr.go


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