StreamReader

Undocumented in source.

Constructors

this
this(EventLoop eventLoop, size_t limit)
Undocumented in source.

Members

Functions

atEof
bool atEof()

Return $(D_KEYWORD true) if the buffer is empty and $(D_PSYMBOL feedEof()) was called.

feedData
void feedData(const(void)[] data)

Feed $(D_PSYMBOL data) bytes in the internal buffer. Any operations waiting for the data will be resumed.

feedEof
void feedEof()

Acknowledge the EOF.

read
const(void)[] read(ptrdiff_t n)

Read up to $(D_PSYMBOL n) bytes. If $(D_PSYMBOL n) is not provided, or set to -1, read until EOF and return all read bytes.

readExactly
const(void)[] readExactly(size_t n)

Read exactly $(D_PSYMBOL n) bytes. Raise an $(D_PSYMBOL IncompleteReadError) if the end of the stream is reached before $(D_PSYMBOL n) bytes can be read, the $(D_PSYMBOL IncompleteReadError.partial) attribute of the exception contains the partial read bytes.

readLine
const(char)[] readLine()

Read one line, where “line” is a sequence of bytes ending with '\n'.

setException
void setException(Throwable exception)

Set the exception.

setTransport
void setTransport(ReadTransport transport)

Set the transport.

Properties

exception
Throwable exception [@property getter]

Get the exception.

Meta