Hi all, I'm implementing an application that downloads some files via sockets. After the download I locally save the files. The problem is that every time it includes a header before the text and don't want that to happen. I'm using the following to get the input stream: InputStream input = new BufferedInputStream(socket1.getInoutStream); Is this the problem? How to get rid of the header in the local files? Thanks, Alessandro.
Well, I'm going to guess that your sockets are connected to a Web server, or some other Internet server that sends more than just the file back to you when you request a file. There are two things you might do. One is to parse the data from the sockets and remove the headers yourself. Another, far easier solution is to use URLConnection instead of raw sockets; it will remove the headers for you; e.g., like this.