Java DataInputStream.readLine() stuck with Python connection.recv()

I have a problem with python recv() function. I have Client Java with Server Python and I want to send command to Client. Without connection.recv() the data sent, but with connection.recv() no data sent and Java readLine() waiting for input.

Here is my Python Server :-

import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("192.168.1.8", 2307))
sock.listen()
con, adr = sock.accept()
con.sendall(b"download test.txt")
data = con.recv(4096)

and here is my Java Client :-

import java.io.*;
import java.net.Socket;
import java.util.Base64;


public class Main {

    public static void main(String[] args) throws IOException {

        Socket Client = new Socket("192.168.1.8", 2307);
        DataOutputStream Output = new DataOutputStream(Client.getOutputStream());
        DataInputStream Input = new DataInputStream(Client.getInputStream());
        FileInputStream getFileStream = null;
        int bufLength = 2048;
        byte[] buffer = new byte[2048];
        String savePath = "C:\\Users\\Aragami\\Desktop\\Python\\test.txt";
        byte[] data;
        String str = "";
        String ack;

        try {
            str = Input.readLine();
        }catch (Exception e)
        {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        if(str.split(" ")[0].trim().equals("download")) {
            String fileName = str.split(" ")[1].trim();
            getFileStream = new FileInputStream("C:\\Users\\Aragami\\IdeaProjects\\droidClient\\src\\" + fileName);
        }
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int readLength;
        while ((readLength = getFileStream.read(buffer, 0, bufLength)) != -1) {
            out.write(buffer, 0, readLength);
        }

        data = out.toByteArray();

        String imageString = Base64.getEncoder().encodeToString(data);

        FileWriter fileWriter = new FileWriter(savePath);

        int firstIndex = 0;
        int lastIndex = 4096;
        int lengthOfFile = imageString.length();
        while(lengthOfFile > 0)
        {
            if(lengthOfFile >= 4096)
            {
                Output.writeUTF(imageString.substring(firstIndex,lastIndex));
                firstIndex += 4096;
                lastIndex += 4096;
                lengthOfFile -= 4096;
            }
            else
            {
                lastIndex = (lastIndex - 4096) + lengthOfFile;
                lengthOfFile = 0;
                Output.writeUTF(imageString.substring(firstIndex,lastIndex));
            }
            ack = Input.readLine();
        }

        Output.writeUTF("DONE");

        fileWriter.write(imageString);

        // close streams
        fileWriter.close();
        out.close();
        getFileStream.close();


    }
}

When i use readUTF() it returns Exception :-

at java.io.DataInputStream.readFully(DataInputStream.java:195)
    at java.io.DataInputStream.readUTF(DataInputStream.java:609)
    at java.io.DataInputStream.readUTF(DataInputStream.java:564)

UPDATE:- The problem was with EO command with python, you have to sent data ends with '\n' so the Java code is clear, but the python code will be :-

import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("192.168.1.8", 2307))
sock.listen()
con, adr = sock.accept()
con.sendall(b"download test.txt" + b'\n') # <= Here its
data = con.recv(4096)