@Override
	public void run() {

		Socket socketFileTransfer;
		try {
			socketFileTransfer = new Socket(ipOfPeer, portFile);
			DataOutputStream writeFile = new DataOutputStream(socketFileTransfer.getOutputStream());
			writeFile.writeUTF(Tags.FILE_DATA_BEGIN);
			writeFile.flush();
			byte[] fileDataToByte = getBytesFromFile(fileData);
			int offset = 0;
			int lenght = fileDataToByte.length;
			
			ObjectOutputStream out = new ObjectOutputStream(socketFileTransfer.getOutputStream());
			while( offset <= lenght ){
				byte[] byteToSend;
				if( (offset + 1024) >= lenght){
					byteToSend = Arrays.copyOfRange(fileDataToByte, offset, lenght);
				}else {
					byteToSend = Arrays.copyOfRange(fileDataToByte, offset, offset + 1024);
				}
				byte[] packData = new byte[11 + byteToSend.length + 12];
				System.arraycopy(Communicate.fileDataStart, 0, packData, 0, 11);
				System.arraycopy(byteToSend, 0, packData, 11, byteToSend.length);
				System.arraycopy(Communicate.fileDataEnd, 0, packData, 11 + byteToSend.length, 12);
				out.writeObject(packData);
				out.flush();
				offset += 1024;
			}	
			out.writeObject(Communicate.endOfTransfer);
			out.flush();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}