TypeEncoder provides encoding for fixed size types. Such as int32 or struct { X int32; Y int64; } "int" is not a fixed size type: int on different platform has different size, 4 or 8 bytes. "[]int32" is not a fixed size type: the data size is also defined by the number of elements.
| 20 | // "[]int32" is not a fixed size type: the data size is also defined by the |
| 21 | // number of elements. |
| 22 | type TypeEncoder struct { |
| 23 | // Endian defines the byte order to encode a value. |
| 24 | // By default it is binary.LittleEndian |
| 25 | Endian binary.ByteOrder |
| 26 | // Type is the data type to encode. |
| 27 | Type reflect.Type |
| 28 | // Size is the encoded size of this type. |
| 29 | Size int |
| 30 | } |
| 31 | |
| 32 | // NewTypeEncoder creates a *TypeEncoder by a value. |
| 33 | // The value "zero" defines what type this Encoder can deal with and must be a |
nothing calls this directly
no outgoing calls
no test coverage detected