UseCompactEncoding causes the Encoder to chose the most compact encoding. For example, it allows to encode small Go int64 as msgpack int8 saving 7 bytes.
(on bool)
| 170 | // UseCompactEncoding causes the Encoder to chose the most compact encoding. |
| 171 | // For example, it allows to encode small Go int64 as msgpack int8 saving 7 bytes. |
| 172 | func (e *Encoder) UseCompactInts(on bool) { |
| 173 | if on { |
| 174 | e.flags |= useCompactIntsFlag |
| 175 | } else { |
| 176 | e.flags &= ^useCompactIntsFlag |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // UseCompactFloats causes the Encoder to chose a compact integer encoding |
| 181 | // for floats that can be represented as integers. |
no outgoing calls