Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot.
(self, input, errors='strict')
| 158 | raise NotImplementedError |
| 159 | |
| 160 | def decode(self, input, errors='strict'): |
| 161 | |
| 162 | """ Decodes the object input and returns a tuple (output |
| 163 | object, length consumed). |
| 164 | |
| 165 | input must be an object which provides the bf_getreadbuf |
| 166 | buffer slot. Python strings, buffer objects and memory |
| 167 | mapped files are examples of objects providing this slot. |
| 168 | |
| 169 | errors defines the error handling to apply. It defaults to |
| 170 | 'strict' handling. |
| 171 | |
| 172 | The method may not store state in the Codec instance. Use |
| 173 | StreamReader for codecs which have to keep state in order to |
| 174 | make decoding efficient. |
| 175 | |
| 176 | The decoder must be able to handle zero length input and |
| 177 | return an empty object of the output object type in this |
| 178 | situation. |
| 179 | |
| 180 | """ |
| 181 | raise NotImplementedError |
| 182 | |
| 183 | class IncrementalEncoder(object): |
| 184 | """ |
no outgoing calls