Created
July 8, 2014 21:32
-
-
Save badlogic/78b81f71183a2f46acf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
public class SslTest { | |
public static void main (String[] args) { | |
try { | |
HttpURLConnection connection = (HttpURLConnection)new URL("https://www.google.at/images/srpr/logo11w.png").openConnection(); | |
// HttpURLConnection connection = (HttpURLConnection)new URL("http://i.imgur.com/XZt9E04.jpg").openConnection(); | |
System.out.println("connection: " + connection); | |
InputStream in = connection.getInputStream(); | |
System.out.println("input stream: " + in); | |
int c = 0; | |
while (in.available() > 0) { | |
in.read(); | |
if (c % 1000 == 0) System.out.println("read byte"); | |
c++; | |
} | |
} catch (MalformedURLException e) { | |
e.printStackTrace(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And the robovm.xml used with this: