code: public void write(int b) {
          try {
              synchronized (this) {
                  ensureOpen();
                  out.write(b);
                  if ((b == '\n') && autoFlush)
                      out.flush();
              }
          }
          catch (InterruptedIOException x) {
              Thread.currentThread().interrupt();
          }
          catch (IOException x) {
              trouble = true;
          }
      }
docs: Writes the specified byte to this stream.  If the byte is a newline and
  automatic flushing is enabled then the <code>flush</code> method will be
  invoked.
  
  <p> Note that the byte is written as given; to write a character that
  will be translated according to the platform's default character
  encoding, use the <code>print(char)</code> or <code>println(char)</code>
  methods.
  
  @param  b  The byte to be written
  @see #print(char)
  @see #println(char)