encodeArray writes an XDR encoded integer representing the number of elements in the passed slice represented by the reflection value followed by the XDR encoded representation of each element in slice to the encapsulated writer and returns the number of bytes written. The ignoreOpaque flag control
(v reflect.Value, ignoreOpaque bool)
| 415 | // RFC Section 4.13 - Variable-Length Array |
| 416 | // Unsigned integer length followed by individually XDR encoded array elements |
| 417 | func (enc *Encoder) encodeArray(v reflect.Value, ignoreOpaque bool) (int, error) { |
| 418 | numItems := uint32(v.Len()) |
| 419 | n, err := enc.EncodeUint(numItems) |
| 420 | if err != nil { |
| 421 | return n, err |
| 422 | } |
| 423 | |
| 424 | n2, err := enc.encodeFixedArray(v, ignoreOpaque) |
| 425 | n += n2 |
| 426 | return n, err |
| 427 | } |
| 428 | |
| 429 | // encodeStruct writes an XDR encoded representation of each value in the |
| 430 | // exported fields of the struct represented by the passed reflection value to |
no test coverage detected