Name: rlT66838 Date: 07/19/99
The following code leaves out the first six bytes of the file:
----
import java.net.*;
import java.io.*;
import java.util.*;
public class bug {
public static void main(String[] args) {
String url = "ftp://jet.corp.fedex.com/pub/jet/release/Manifest";
try {
int totalBytes = 0;
URL location = new URL(url);
InputStream stream = (InputStream)location.getContent();
byte[] buffer = new byte[1024];
int bytesRead = stream.read(buffer);
while (bytesRead != -1) {
totalBytes += bytesRead;
bytesRead = stream.read(buffer);
}
System.err.println(totalBytes + " bytes downloaded");
} catch (Exception e) {
e.printStackTrace();
}
System.exit(0);
}
}
(Review ID: 85774)
======================================================================