Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamWriter for codec
(self, input, errors='strict')
| 139 | |
| 140 | """ |
| 141 | def encode(self, input, errors='strict'): |
| 142 | |
| 143 | """ Encodes the object input and returns a tuple (output |
| 144 | object, length consumed). |
| 145 | |
| 146 | errors defines the error handling to apply. It defaults to |
| 147 | 'strict' handling. |
| 148 | |
| 149 | The method may not store state in the Codec instance. Use |
| 150 | StreamWriter for codecs which have to keep state in order to |
| 151 | make encoding efficient. |
| 152 | |
| 153 | The encoder must be able to handle zero length input and |
| 154 | return an empty object of the output object type in this |
| 155 | situation. |
| 156 | |
| 157 | """ |
| 158 | raise NotImplementedError |
| 159 | |
| 160 | def decode(self, input, errors='strict'): |
| 161 |
no outgoing calls