module documentation
Various I/O related utility functions.
| Function | read |
Read n bytes in total from f. |
| Function | read |
Read a zero-terminated bytestring from a file. |
Read n bytes in total from f.
If raise_on_incomplete is zero, this may return less bytes on EOF. Otherwise, an exception is raised.
| Parameters | |
| f:file-like | file-like object to read from |
n:int | number of bytes to read |
raisebool | if nonzero, raise an Exception if unable to read full n bytes |
| Returns | |
bytes | the content read |
| Raises | |
IOError | when raise_in_incomplete is nonzero and unable to read full n bytes. |
Read a zero-terminated bytestring from a file.
| Parameters | |
| f:file-like object | file-like object to read from |
encoding:str or None | if specified, decode the string using this encoding |
stripbool | if nonzero (default), do not add the zero to the result string |
| Returns | |
bytes or str if an encoding was specified | the parsed string. |