Module codecs :: Class StreamWriter

[show private | hide private]
[frames | no frames]

## Class StreamWriter

    Codec --+
            |
           StreamWriter

Known Subclasses:
  `StreamWriter`

Method Summary
| ``__init__`(self, stream, errors)` Creates a StreamWriter instance.
| ``__getattr__`(self, name, getattr)` Inherit all other methods from the underlying stream.
| ``decode`(self, input, errors)` Decodes the object input and returns a tuple (output object, length consumed). (inherited from `Codec`)
| ``encode`(self, input, errors)` Encodes the object input and returns a tuple (output object, length consumed). (inherited from `Codec`)
| ``reset`(self)` Flushes and resets the codec buffers used for keeping state.
| ``write`(self, object)` Writes the object's contents encoded to self.stream.
| ``writelines`(self, list)` Writes the concatenated list of strings to the stream using .write().

Method Details

### __init__(self, stream, errors='strict')
(Constructor)

    Creates a StreamWriter instance.

    stream must be a file-like object open for writing
    (binary) data.

    The StreamWriter may implement different error handling
    schemes by providing the errors keyword argument. These
    parameters are defined:

     'strict' - raise a ValueError (or a subclass)
     'ignore' - ignore the character and continue with the next
     'replace'- replace with a suitable replacement character

### __getattr__(self, name, getattr=<built-in function getattr>)
(Qualification operator)

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.

### write(self, object)

Writes the object's contents encoded to self.stream.

### writelines(self, list)

Writes the concatenated list of strings to the stream using .write().

Generated by Epydoc 1.1 on Thu May 8 13:18:16 2003 | http://epydoc.sf.net