writeBufferPart method
Implementation
Future<void> writeBufferPart(Uint8List buffer, int start, int length) {
if (_closed) {
throw StateError("Cannot write to socket, it is closed");
}
if (_writingBuffer != null) {
throw StateError("Cannot write to socket, already writing");
}
_writingBuffer = buffer;
_writeCompleter = Completer<void>();
_writeOffset = start;
_writeLength = length + start;
_writeBuffer();
return _writeCompleter.future;
}