Add AppendXDR to XDR types, build.sh xdr
This commit is contained in:
@@ -13,10 +13,14 @@ func (o File) EncodeXDR(w io.Writer) (int, error) {
|
||||
}
|
||||
|
||||
func (o File) MarshalXDR() []byte {
|
||||
var buf bytes.Buffer
|
||||
var xw = xdr.NewWriter(&buf)
|
||||
return o.AppendXDR(make([]byte, 0, 128))
|
||||
}
|
||||
|
||||
func (o File) AppendXDR(bs []byte) []byte {
|
||||
var aw = xdr.AppendWriter(bs)
|
||||
var xw = xdr.NewWriter(&aw)
|
||||
o.encodeXDR(xw)
|
||||
return buf.Bytes()
|
||||
return []byte(aw)
|
||||
}
|
||||
|
||||
func (o File) encodeXDR(xw *xdr.Writer) (int, error) {
|
||||
@@ -39,8 +43,8 @@ func (o *File) DecodeXDR(r io.Reader) error {
|
||||
}
|
||||
|
||||
func (o *File) UnmarshalXDR(bs []byte) error {
|
||||
var buf = bytes.NewBuffer(bs)
|
||||
var xr = xdr.NewReader(buf)
|
||||
var br = bytes.NewReader(bs)
|
||||
var xr = xdr.NewReader(br)
|
||||
return o.decodeXDR(xr)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user