byte[] b = new byte[128];
try {
Socket s = new Socket("metalab.unc.edu", 9);
OutputStream theOutput = s.getOutputStream();
while (true) {
int n = theInput.available();
if (n > b.length) n = b.length;
int m = theInput.read(b, 0, n);
if (m == -1) break;
theOutput.write(b, 0, n);
}
s.close();
}
catch (IOException e) {}