private boolean transmitPacket(byte[] buf, int j) {
        int i = 0;
        boolean packet_sent = false;
        DatagramPacket ack_dtg = new DatagramPacket(new byte[1024], 1024);

        while (i < 3 || packet_sent) {
            DATAPacket data_packet = new DATAPacket(buf, this.getIp(), this.getPort_dest(), j);
            try {
                System.out.println("DATA :" + Arrays.toString(data_packet.getData()));
                this.getSocket().send(data_packet.getDtg());
                this.getSocket().receive(ack_dtg);
                //Test if the answer is correct
                if (ACKPacket.isACKPacket(ack_dtg) && j == ACKPacket.getBlockNb(ack_dtg)) {
                    System.out.println("ACK  :" + Arrays.toString(ack_dtg.getData()));
                    packet_sent = true;
                    fireProccessingSend((int) (((float) j / (file.length() / 512)) * 100));
                    return true;
                }
            } catch (IOException ex) {
                System.out.println("Echec transfert du paquet");
                fireErrorOccured("Echec transfert du paquet");
            }
            i++;
        }
        return packet_sent;
    }