Writes buffer to the socket, and returns the same buffer in a Future which completes when it has all been written.
buffer
Future<void> writeBuffer(Uint8List buffer) { return writeBufferPart(buffer, 0, buffer.length); }