I'm trying to create a program that will download only a portion of a file. From everything I could find on the subject I'm doing it correctly, but the program still downloads the entire file. What have I done wrong? Is it possible to do what I'm trying to do with Java? Can someone please point me in the right direction? Thank you. The code is below. Also, it doesn't seem to matter if the server supports response or not.


Code:
import java.io.*;
import java.net.*;


public class FileDownload2 {
	public static void download() {
		OutputStream out = null;
		RandomAccessFile file = null;
		URLConnection conn = null;
		InputStream  in = null;
		try {


URL url = new URL("http://www32.megaupload.com/files/c7c6f4ce249c6ccad7583a8f6ea943a8/Kanye%20West%20Nas%20&%20KRS-One%20-%20Classic%20(Midas%20Touch%20Remix).mp3");
			conn = url.openConnection();
			conn.setRequestProperty("Range", "901600-");
			in = conn.getInputStream();
			byte[] buffer = new byte[1024];
	 		out = new FileOutputStream("test");
			
			
			int numRead;
			long numWritten = 0;
			while ((numRead = in.read(buffer)) != -1) {
				
				out.write(buffer, 0, numRead);
				numWritten += numRead;
			}
			
		} catch (Exception exception) {
			exception.printStackTrace();
		} finally {
			try {
				if (in != null) {
					in.close();
				}
				if (out != null) {
					out.close();
				}
			} catch (IOException ioe) {
			}
		}
	}



	public static void main(String[] args) {
			download();
		
	}
}