Example #1
0
func (o *XDRBenchStruct) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.I1 = u.UnmarshalUint64()
	o.I2 = u.UnmarshalUint32()
	o.I3 = u.UnmarshalUint16()
	o.I4 = u.UnmarshalUint8()
	o.Bs0 = u.UnmarshalBytesMax(128)
	o.Bs1 = u.UnmarshalBytes()
	_Is0Size := int(u.UnmarshalUint32())
	if _Is0Size < 0 {
		return xdr.ElementSizeExceeded("Is0", _Is0Size, 0)
	} else if _Is0Size == 0 {
		o.Is0 = nil
	} else {
		if _Is0Size <= len(o.Is0) {
			o.Is0 = o.Is0[:_Is0Size]
		} else {
			o.Is0 = make([]int32, _Is0Size)
		}
		for i := range o.Is0 {
			o.Is0[i] = int32(u.UnmarshalUint32())
		}
	}
	o.S0 = u.UnmarshalStringMax(128)
	o.S1 = u.UnmarshalString()
	return u.Error
}
Example #2
0
func (o *FileInfoTruncated) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Name = u.UnmarshalStringMax(8192)
	o.Flags = u.UnmarshalUint32()
	o.Modified = int64(u.UnmarshalUint64())
	(&o.Version).UnmarshalXDRFrom(u)
	o.LocalVersion = int64(u.UnmarshalUint64())
	_BlocksSize := int(u.UnmarshalUint32())
	if _BlocksSize < 0 {
		return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 1000000)
	} else if _BlocksSize == 0 {
		o.Blocks = nil
	} else {
		if _BlocksSize > 1000000 {
			return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 1000000)
		}
		for i := 0; i < _BlocksSize; i++ {
			size := int64(u.UnmarshalUint32())
			o.CachedSize += size
			u.UnmarshalBytes()
		}
	}

	return u.Error
}
Example #3
0
func (o *ResponseMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Data = u.UnmarshalBytes()
	o.Code = int32(u.UnmarshalUint32())
	return u.Error
}
Example #4
0
func (o *fileVersion) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	(&o.version).UnmarshalXDRFrom(u)
	o.device = u.UnmarshalBytes()
	return u.Error
}