Created
November 23, 2017 15:38
-
-
Save ushkinaz/c4b22bb384ecf58c407828c07ab59b64 to your computer and use it in GitHub Desktop.
TLS v1.2 test
This file contains hidden or 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.BufferedInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
public class TLS12Test { | |
public TLS12Test() { | |
} | |
public static void main(String[] args) throws IOException { | |
URL url = new URL("https://stage.cps-it.ru/loaderio-e707b6eb86109840011bb23c8d33a006.txt"); | |
InputStream in = new BufferedInputStream(url.openStream()); | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
byte[] buf = new byte[1024]; | |
int n; | |
while(-1 != (n = in.read(buf))) { | |
out.write(buf, 0, n); | |
} | |
out.close(); | |
in.close(); | |
System.out.println(new String(out.toByteArray())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment