class documentation

class BufferedPktLineWriter:

Constructor: BufferedPktLineWriter(write, bufsize)

View In Hierarchy

Writer that wraps its data in pkt-lines and has an independent buffer.

Consecutive calls to write() wrap the data in a pkt-line and then buffers it until enough lines have been written such that their total length (including length prefix) reach the buffer size.

Method __init__ Initialize the BufferedPktLineWriter.
Method flush Flush all data from the buffer.
Method write Write data, wrapping it in a pkt-line.
Instance Variable _buflen Undocumented
Instance Variable _bufsize Undocumented
Instance Variable _len Undocumented
Instance Variable _wbuf Undocumented
Instance Variable _write Undocumented
def __init__(self, write: Callable[[bytes], int | None], bufsize: int = 65515):

Initialize the BufferedPktLineWriter.

Parameters
write:Callable[[bytes], int | None]A write callback for the underlying writer.
bufsize:intThe internal buffer size, including length prefixes.
def flush(self):

Flush all data from the buffer.

def write(self, data: bytes):

Write data, wrapping it in a pkt-line.

_buflen: int =

Undocumented

_bufsize =

Undocumented

_len: int =

Undocumented

_wbuf =

Undocumented

_write =

Undocumented