Part of bzrlib.smart.medium View In Hierarchy
Known subclasses: bzrlib.smart.medium.SmartClientMedium, bzrlib.smart.medium.SmartServerStreamMedium
Method | __init__ | Undocumented |
Method | read_bytes | Read some bytes from this medium. |
Method | _push_back | Return unused bytes to the medium, because they belong to the next |
Method | _get_push_back_buffer | Undocumented |
Method | _read_bytes | Undocumented |
Method | _get_line | Read bytes from this request's response until a newline byte. |
Method | _report_activity | Notify that this medium has activity. |
This sets the _push_back_buffer to the given bytes.
Returns | some bytes, possibly more or less than the number requested in 'desired_count' depending on the medium. |
This isn't particularly efficient, so should only be used when the expected size of the line is quite short.
Returns | a string of bytes ending in a newline (byte 0x0A). |
Implementations should call this from all methods that actually do IO. Be careful that it's not called twice, if one method is implemented on top of another.
Parameters | bytes | Number of bytes read or written. |
direction | 'read' or 'write' or None. |