close method
Closes the sink.
The add method must not be called after this method.
Calling this method more than once is allowed, but does nothing.
Implementation
@override
void close() {
if (_isClosed) {
return;
}
_isClosed = true;
sleep = false;
while (!sleep) {
final h = _handler;
_handler = null;
if (h == null) {
break;
}
h();
}
if (buffering != 0) {
throw StateError('On closing, an incomplete buffering was detected');
}
final length = getLength(data);
if (length != 0) {
data = _empty;
}
}