import java.net.*;
import java.io.*;

public class TimeURLTest {
    public static void main(String [] args) throws Exception {
        URL.setURLStreamHandlerFactory(new MyStreamHandlerFactory());
        URL url=new URL("time://tock.usno.navy.mil");
        InputStream is=url.openStream();
        int c;
        do {
            c=is.read();
            if (c!=-1) System.out.print((char)c);
        } while (c!=-1);
        is.close();
    }
}
