class IO::Stream::Generic

def drain(buffer)

def drain(buffer)
te(buffer)
he write operation fails, we still need to clear this buffer, and the data is essentially lost.
.clear