I got working server and client applications, they work perfect while sending small files, but when I try to send for example movie file that is 700mb over socket it gives m
It gives you OutOfMemoryError because you are trying to read the entire file into memory before sending it. This is 100% completely and utterly unnecessary. Just read and write chunks, much as you are doing in the receiving code.