ここに私が得るものがあります:
そして、ここに私の完全なコードがあります:
import java.net.*;
import java.io.*;
class whois {
public static void main(String args[])throws Exception {
int c;
Socket s=new Socket("whois.internic.net",43);
InputStream in=s.getInputStream();
OutputStream out=s.getOutputStream();
String str=(args.length==0 ? "www.osborne.com" : args[0])+"\n";
byte buf[]=str.getBytes();
out.write(buf);
while((c=in.read())!=-1) {
System.out.print((char)c);
}
s.close();
}
}
これにアクセスしてosborne.com と入力すると、このドメインに関する情報が表示されます。しかし、私は別の出力を得ています。これの理由は何ですか?説明してください。