public void SendFile(string path) { if (_fileUtils.FileExists(path)) { var fileName = _fileUtils.GetFileName(path); _communication.Write(_conversionHandler.ConvertIntToBytes(fileName.Length)); _communication.Write(_conversionHandler.ConvertStringToBytes(fileName)); var fileSize = _fileUtils.GetFileSize(path); _communication.Write(_conversionHandler.ConvertLongToBytes(fileSize)); SendFileWithStream(fileSize, path); } else { throw new Exception("Image doesn't exist"); } }