Basically I'm looking to transfer files from a URLConnection object to a file. Although ASCII transfers fine over this method I get a few off characters in transferring a binary file (ie: a jpg image) giving the following output...
URL site = new URL(jTextField1.getText());
URLConnection sock = site.openConnection();
FileWriter fd = new FileWriter(jTextField2.getText());
BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
for (int i = 0; i < sock.getContentLength(); i++)
Essentially I figured since in.read() and fd.write() return and accept an int argument that this would be more than enough space for a byte field and therefore wouldn't drop any data. Any ideas?