mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-06-26 13:25:52 +00:00
Initial revision
From-SVN: r102074
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
|
||||
public class URLTest
|
||||
{
|
||||
public static void main(String args[])
|
||||
{
|
||||
try {
|
||||
URL url = new URL("http://www.hungry.com/");
|
||||
InputStream stream = url.openStream();
|
||||
|
||||
int size = 0;
|
||||
|
||||
while (-1 != stream.read()) { size++; }
|
||||
|
||||
stream.close();
|
||||
|
||||
System.out.println("PASSED: new URL() size=" + size );
|
||||
} catch (Exception e) {
|
||||
System.out.println("FAILED: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user