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