title: How can I print what is read by intputstream immediately?
body: <p>This is the code I have:</p>
  
  <pre><code>import java.io.DataInputStream;
  import java.io.InputStream;
  
  public class TestClass {
      public static void main(String[] args) throws Exception {
          InputStream inputStream = new DataInputStream(System.in);
          int read = inputStream.read();
          System.out.println(read);
      }
  }
  </code></pre>
  
  <p>When I run this code inputStream will wait for input from the standard input which is fine. When I type 'a' in keyboard, I expect 97 to be printed immediately in the console. However this code requires me to hit 'Enter' after I type 'a'. </p>
  
  <p>If I simply hit 'Enter' integer 10 will be shown in the console.</p>
  
  <p>How can I modify the code so that as soon as I hit 'a' in the keyboard I see the integer 97? What is so special about the Enter button in this case? Why do I need to hit Enter?</p>