| | |
- codecs.Codec
-
- Codec
-
- StreamReader(Codec, codecs.StreamReader)
- StreamWriter(Codec, codecs.StreamWriter)
class Codec(codecs.Codec) |
| |
|
| |
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'encodings.utf_16'
- decode = <built-in function utf_16_decode>
- encode = <built-in function utf_16_encode>
|
class StreamReader(Codec, codecs.StreamReader) |
| |
|
| |
- Method resolution order:
- StreamReader
- Codec
- codecs.Codec
- codecs.StreamReader
Methods defined here:
- __init__(self, stream, errors='strict')
- read(self, size=-1)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'encodings.utf_16'
Data and non-method functions inherited from Codec:
- decode = <built-in function utf_16_decode>
- encode = <built-in function utf_16_encode>
Methods inherited from codecs.StreamReader:
- __getattr__(self, name, getattr=<built-in function getattr>)
- Inherit all other methods from the underlying stream.
- readline(self, size=None)
- Read one line from the input stream and return the
decoded data.
Note: Unlike the .readlines() method, this method inherits
the line breaking knowledge from the underlying stream's
.readline() method -- there is currently no support for
line breaking using the codec decoder due to lack of line
buffering. Sublcasses should however, if possible, try to
implement this method using their own knowledge of line
breaking.
size, if given, is passed as size argument to the stream's
.readline() method.
- readlines(self, sizehint=0)
- Read all lines available on the input stream
and return them as list of lines.
Line breaks are implemented using the codec's decoder
method and are included in the list entries.
sizehint, if given, is passed as size argument to the
stream's .read() method.
- reset(self)
- Resets the codec buffers used for keeping state.
Note that no stream repositioning should take place.
This method is primarily intended to be able to recover
from decoding errors.
|
class StreamWriter(Codec, codecs.StreamWriter) |
| |
|
| |
- Method resolution order:
- StreamWriter
- Codec
- codecs.Codec
- codecs.StreamWriter
Methods defined here:
- __init__(self, stream, errors='strict')
- write(self, data)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'encodings.utf_16'
Data and non-method functions inherited from Codec:
- decode = <built-in function utf_16_decode>
- encode = <built-in function utf_16_encode>
Methods inherited from codecs.StreamWriter:
- __getattr__(self, name, getattr=<built-in function getattr>)
- Inherit all other methods from the underlying stream.
- reset(self)
- Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.
- writelines(self, list)
- Writes the concatenated list of strings to the stream
using .write().
| |