Created
March 25, 2014 05:38
-
-
Save cbsmith/9755809 to your computer and use it in GitHub Desktop.
A simply gist demonstrating how to copy from stdin to stdout in Java, in response to discussion of: https://news.ycombinator.com/item?id=7463671
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
| public class Copy { | |
| public static void main(String[] args) throws Throwable { | |
| int next; | |
| while ((next = System.in.read()) != -1) { | |
| System.out.write(next); | |
| } | |
| System.out.flush(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment