I am new to Java The problem is that I am right now that I am sending a file name from the client to the server. When I print that filename in the server, it prints fine, but it does not match the string that is my hard-coded. Example: I used to write 'Lecture.PDF' as a file name from classic to server 'And then I match the string filename obtained with the string' Lactuation PDF ', it does not match and finally returns false. I hope to return the same method (as it should be).
Here is a code snippet that can display the problem. The 'server' here is the purpose of the socket, and I am reading the file name using the byte array:
InputStream = faucet; Byte reaction [] = new byte [50]; Is = server.getInputStream (); Is.read (feedback); String str_res = new string (response); System.out.println ("Understand:" + str_res); System.out.println ("Result:" + (response.toString ()). Equals ("lecture pdf"));