@Override
	public void run() {
		initializeLogger();
		Thread currentThread = Thread.currentThread();
		this.log.fine("Get current Thread");
		File file = new File(this.fileName);
		this.log.fine("Create new file: " + file.toString());
		InputStream fileReader = getFileReader(file);
		if (fileReader == null) return;
		
		byte buffer[] = new byte[this.packageSize];
		this.log.fine("Create new buffer: " + buffer.toString());
		Socket clientSocket = null;
		int waitTimes = 4;
		while (waitTimes -- > 0 && clientSocket == null) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
				closeAll(fileReader, null, null);
				return;				
			}
			clientSocket = getClientSocket();
		}
		if (clientSocket == null) {
			closeAll(fileReader, null, null);
			return;
		}	
		

		PrintStream printStream = getPrintStream(clientSocket);
		if (printStream == null) {
			closeAll(fileReader, clientSocket, null);
			return;
		}
		try {
			long rowId = 0;
			while (fileReader.available() > 0) {
				if (currentThread.isInterrupted()) {
					closeAll(fileReader, clientSocket, null);
					return;
				}
				fileReader.read(buffer);
				printStream.write(buffer);
				System.out
						.println("file-row-" + (rowId++)
								+ "-base64-encoded-with-" + this.packageSize
								+ "-bytes");
				this.log.fine("file-row-" + (rowId++)
								+ "-base64-encoded-with-" + this.packageSize
								+ "-bytes");
			}
			closeAll(fileReader, clientSocket, null);
			
		} catch (Exception e) {
			e.printStackTrace();
			closeAll(fileReader, clientSocket, null);
		}
	}